From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0004.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0004.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0004.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0004.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070420/5cb125f8/attachment-0004.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0004.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0004.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0004.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0004.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0004.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0004.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0004.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/0cb5ea16/attachment-0004.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0004.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0005.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0005.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0005.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0005.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070420/5cb125f8/attachment-0005.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0005.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0005.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0005.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0005.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0005.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0005.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0005.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/0cb5ea16/attachment-0005.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0005.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0006.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0006.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0006.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0006.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070420/5cb125f8/attachment-0006.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0006.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0006.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0006.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0006.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0006.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0006.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0006.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/0cb5ea16/attachment-0006.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0006.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0007.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0007.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0007.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0007.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070420/5cb125f8/attachment-0007.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0007.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0007.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0007.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0007.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0007.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0007.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0007.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/0cb5ea16/attachment-0007.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0007.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0008.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0008.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0008.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0008.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070420/5cb125f8/attachment-0008.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0008.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0008.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0008.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0008.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0008.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0008.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0008.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/0cb5ea16/attachment-0008.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0008.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0009.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0009.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0009.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0009.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0009.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0009.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0009.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0009.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0009.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0009.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0009.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0009.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0010.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0010.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0010.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0010.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0001.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0010.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0010.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0010.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0010.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0010.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0010.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0010.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0001.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0010.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0011.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0011.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0011.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0011.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0002.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0011.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0011.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0011.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0011.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0011.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0011.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0011.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0002.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0011.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0012.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0012.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0012.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0012.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0003.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0012.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0012.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0012.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0012.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0012.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0012.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0012.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0003.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0012.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0013.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0013.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0013.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0013.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0004.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0013.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0013.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0013.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0013.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0013.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0013.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0013.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0004.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0013.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0014.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0014.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0014.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0014.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0005.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0014.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0014.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0014.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0014.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0014.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0014.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0014.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0005.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0014.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0015.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0015.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0015.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0015.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0006.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0015.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0015.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0015.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0015.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0015.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0015.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0015.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0006.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0015.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0016.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0016.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0016.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0016.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0007.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0016.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0016.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0016.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0016.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0016.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0016.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0016.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0007.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0016.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0017.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0017.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0017.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0017.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0008.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0017.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0017.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0017.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0017.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0017.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0017.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0017.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0008.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0017.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0018.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0018.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0018.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0018.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0009.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0018.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0018.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0018.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0018.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0018.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0018.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0018.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0009.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0018.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0019.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0019.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0019.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0019.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0010.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0019.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0019.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0019.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0019.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0019.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0019.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0019.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0010.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0019.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0020.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0020.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0020.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0020.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0011.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0020.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0020.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0020.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0020.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0020.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0020.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0020.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0011.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0020.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0021.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0021.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0021.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0021.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0012.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0021.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0021.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0021.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0021.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0021.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0021.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0021.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0012.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0021.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0022.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0022.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0022.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0022.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0013.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0022.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0022.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0022.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0022.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0022.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0022.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0022.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0013.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0022.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0023.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0023.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0023.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0023.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0014.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0023.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0023.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0023.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0023.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0023.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0023.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0023.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0014.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0023.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0024.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0024.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0024.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0024.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0015.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0024.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0024.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0024.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0024.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0024.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0024.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0024.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0015.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0024.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0025.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0025.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0025.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0025.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0016.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0025.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0025.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0025.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0025.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0025.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0025.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0025.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0016.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0025.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0026.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0026.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0026.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0026.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0017.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0026.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0026.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0026.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0026.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0026.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0026.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0026.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0017.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0026.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0027.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0027.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0027.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0027.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0018.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0027.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0027.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0027.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0027.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0027.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0027.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0027.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0018.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0027.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0028.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0028.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0028.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0028.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0019.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0028.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0028.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0028.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0028.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0028.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0028.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0028.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0019.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0028.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0029.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0029.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0029.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0029.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0020.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0029.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0029.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0029.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0029.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0029.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0029.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0029.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0020.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0029.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0030.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0030.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0030.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0030.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0021.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0030.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0030.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0030.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0030.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0030.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0030.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0030.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0021.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0030.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0031.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0031.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0031.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0031.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0022.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0031.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0031.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0031.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/dirk.niemeier-0031.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/dirk.niemeier-0031.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0031.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0031.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0022.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/BUILD_INFO-0031.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0032.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0032.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0032.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0032.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0023.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0032.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0032.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0032.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/attachment.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/attachment.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0032.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0032.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0023.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/attachment.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0033.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0033.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0033.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0033.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0024.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0033.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0033.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0033.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/attachment-0001.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/attachment-0001.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0033.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0033.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0024.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/attachment-0001.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0034.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0034.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0034.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0034.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0025.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0034.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0034.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0034.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/attachment-0002.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/attachment-0002.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0034.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0034.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0025.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/attachment-0002.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0035.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0035.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0035.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0035.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0026.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0035.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0035.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0035.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/attachment-0003.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/attachment-0003.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0035.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0035.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0026.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/attachment-0003.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0036.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0036.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0036.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0036.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0027.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0036.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0036.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0036.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/attachment-0004.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/attachment-0004.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0036.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0036.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0027.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/attachment-0004.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0037.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0037.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0037.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0037.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0028.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0037.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0037.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0037.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/attachment-0005.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/attachment-0005.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0037.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0037.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0028.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/attachment-0005.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0038.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0038.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0038.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0038.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0029.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0038.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0038.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0038.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/attachment-0006.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/attachment-0006.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0038.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0038.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0029.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/attachment-0006.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0039.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0039.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0039.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0039.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0030.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0039.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0039.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0039.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/attachment-0007.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/attachment-0007.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0039.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0039.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0030.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/attachment-0007.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0040.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0040.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0040.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0040.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0031.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0040.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0040.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0040.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/attachment-0008.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/attachment-0008.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0040.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0040.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0031.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/attachment-0008.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0041.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0041.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0041.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0041.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0032.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0041.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0041.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0041.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/attachment-0009.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/attachment-0009.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0041.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0041.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0032.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/attachment-0009.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0042.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0042.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0042.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0042.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0033.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0042.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0042.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0042.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/attachment-0010.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/attachment-0010.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0042.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0042.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0033.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/attachment-0010.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0043.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0043.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0043.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0043.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0034.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0043.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0043.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0043.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/attachment-0011.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. >> I dont know why the reading doesn't work. Any suggestions ? >> >> regards >> >> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/bea6fda9/attachment-0011.vcf From ejy at SummitBid.com Tue Apr 24 05:07:03 2007 From: ejy at SummitBid.com (Ed Young) Date: Tue, 24 Apr 2007 05:07:03 -0600 Subject: [Rxtx] My favorite podcast Message-ID: http://www.radioopensource.org/ Donny, this is a really good podcast that calls itself "a blog with a radio show". Christopher Lydon is a very articulate guy and the discussions are always very good. here's a link to the podcast: http://www.radioopensource.org/podcasting/ Hope all is well with you all. -- Ed From raman_agarwal82 at yahoo.com Sun Apr 1 11:25:25 2007 From: raman_agarwal82 at yahoo.com (Raman Agarwal) Date: Sun, 01 Apr 2007 17:25:25 -0000 Subject: [Rxtx] SerialPortEvent.DATA_AVAILABLE not listening !! Message-ID: <506615.93205.qm@web34307.mail.mud.yahoo.com> Hi, I used the following Java code to connect two computers through a PSTN modem. It works perfectly fine with Java.comm library but somehow doesnt with RXTXcomm. My diagnosis indicate that the SerialPortEvent.DATA_AVAILABLE doesnot listen even if the remote PC has transferred some data to the listening PC. I have made sure that my machine isnt busy in any other task and no new constructors are getting initialized, etc. Can anyone suggest what is the problem and where do i need to modify the code. In my experiment, I executed my java code on a PC and ran Hyperterminal on the other. Once the modems got "connected", i typed various strings in the Hyperterminal and expected them to appear on the first PC (running the java code). Like mentioned before, this works fine with "import java.comm.*" and not with "import gnu.io.*" JRE = 1.5.0_06 JDK = 1.5 RXTX version = 2.1 Thanks in advance, Raman Agarwal --------------- Here is the relevant code snippet :- ========================================== public void run(){ try{ try{ portId1 = CommPortIdentifier.getPortIdentifier(ComPort); } catch (Exception e) { TimeStamp = new java.util.Date().toString(); text.append(TimeStamp + ": ComPort " + portId1 + "\n"); text.append(TimeStamp + ": msg1 - " + e + "\n"); text.append("\n+++++++++ Restart Application ++++++++\n\n"); ComError = true; } if (ComError == false) { try { TimeStamp = new java.util.Date().toString(); serialPort1 = (SerialPort) portId1.open("Modem_Diagnostics", 2000); text.append(TimeStamp + ": " + portId1.getName() + " opened for i/o" + "\n"); } catch (PortInUseException e) {} try { serialPort1.setSerialPortParams(BaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort1.setDTR(true); //serialPort1.setRTS(true); serialPort1.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN & SerialPort.FLOWCONTROL_RTSCTS_OUT); //serialPort1.enableReceiveTimeout(3000); } catch (UnsupportedCommOperationException e) {} // initializing the serial port try { serialPort1.addEventListener(this); } catch (TooManyListenersException e){} serialPort1.notifyOnDataAvailable(true); serialPort1.notifyOnCarrierDetect(true); serialPort1.notifyOnBreakInterrupt(true); serialPort1.notifyOnCTS(true); serialPort1.notifyOnDSR(true); serialPort1.notifyOnFramingError(true); serialPort1.notifyOnOutputEmpty(true); serialPort1.notifyOnOverrunError(true); serialPort1.notifyOnParityError(true); // *************** protocol to initialize modem, starts here... ************** char received_data; // send "at" writeData('a'); writeData('t'); writeData('\r'); // wait for 1 sec for the modem to accept this command // update the textbox in the meantime myThread.sleep(1000); text.append("\nDialing. Please Wait..\n"); // dial a number String Number = "ATDP2569404\r"; char [] Dial = Number.toCharArray(); for(int i=0;i0); }catch(Exception e){} } } ========================================== Project Manager Envirotech Instruments Pvt. Ltd. Online Division A-271 Okhla Phase 1 New Delhi 110020 India Website: www.envirotechindia.com Phone: +91(0)9872469994 --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070401/19f01574/attachment-0043.html From greg.johnson at esrf.fr Wed Apr 4 11:29:26 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 04 Apr 2007 17:29:26 -0000 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete In-Reply-To: References: Message-ID: <6C293B13-210F-4A18-8EEE-6453AAD2BC39@esrf.fr> Hi Pavel, What platform(s) have you seen this on? I have the PortInUseException problem, but hadn't discovered that there might be an expiry issue - I will try and confirm. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2007, at 17:16, Pavel Parkhomenko wrote: > Hello, world! > > I've observed very strange behaviour in SerialPort close() method. > When I try to close() the port, it doesn't do it immediately, but it > tooks exactly 30 seconds. If I try to reopen the port before these 30 > seconds pass by, I get an PortInUseException. But if I wait 30 seconds > and reopen - all works fine. > Does anybody know what might be the reason? > > -- > Pavel Parkhomenko > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From willitsj at mir.wustl.edu Tue Apr 10 07:04:51 2007 From: willitsj at mir.wustl.edu (Jeffrey Willits) Date: Tue, 10 Apr 2007 08:04:51 -0500 Subject: [Rxtx] Flow control question Message-ID: Hello - new to the list, but I've been using rxtx to develop applications for over a year now. I've set up a program that allows me to capture data from a serial device and then populate a database with the info. On a newer model device, the program works wonderfully. It's a simple RS-232 connection with ASCII exchange sequence to get the data. No problem. THE PROBLEM: I have an older serial device that you simply send 1 ASCII character to - the letter 'D'. The port settings are pretty standard - 9600,n,8,1. Flow control is none and the device works wonderfully from HyperTerminal and another app that I have that runs using SerialIO. However, when I try to send the character 'D' - nothing is returned. I'm not sure what the problem is - various port monitors seem to show the character going out, but nothing comes back. I've played with the threshold and timeouts - no luck. Is there a problem with setting the flow control? I've noticed in the SerialIO source that there are several methods that are part of the Serial Interface - putData and putByte ... does RXTX have these methods buried somewhere? Any help would be great. Thanks, Jeff Snippits of the code follow. Opening the serial port... dcParams.rs232Speed is equal to 9600... serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( dcParams.rs232Speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE ); serialPort.setFlowControlMode( SerialPort.FLOWCONTROL_NONE ); serialPort.disableReceiveTimeout( ); serialPort.enableReceiveThreshold( 12 ); //-- around 15 characters return OR serialPort.enableReceiveTimeout( 250 ); serialPort.disableReceiveThreshold( ); Then, the writing to the serial port... I've used any one of the following: byte[ ] sendCode = new byte[3]; sendCode[0] = (byte)0x44; //D sendCode[1] = (byte)0x0D; //CR sendCode[2] = (byte)0x0A; //LF this.out.write( sendCode, 0, 3 ); OR int sendCode = 68; this.out.write( sendCode ); OR this.out.write( (byte)0x44 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070410/1d479097/attachment-0043.html From liujianweione at 163.com Thu Apr 12 21:53:23 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 11:53:23 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <3276367.807071176436403455.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my email liujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands and then make got: 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 could anyone tell me how to fix this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/0cb5ea16/attachment-0034.html From joachim at buechse.ch Mon Apr 16 01:59:14 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 09:59:14 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <7DAFD97E-5571-4158-9147-190D11E666C6@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 greg.johnson at esrf.fr Wed Apr 18 07:10:19 2007 From: greg.johnson at esrf.fr (Greg Johnson) Date: Wed, 18 Apr 2007 15:10:19 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? It would make life easier for those of us trying to get it running. Cheers, greg ------------------------------------------------------------------------ - Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > > RXTX should work on ARM. I've not tested it but I have compiled > binaries. > > ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 > > The problem is people want various libc combinations such as > uclibc. These should work but I do not have time right now to > provide those. > > The support really is determined by your efforts with ARM. > > > On Tue, 17 Apr 2007, Brian Z wrote: > >> Wow, that really is a shame. From what I've found, Rxtx is the only >> free alternative besides javacomm which isn't an alternative for >> the ARM >> architecture. >> >> I assume Trent reads these messages. Trent, is there anything you >> can >> add to this thread....even "Rxtx won't support ARM" would be >> helpful. :>) >> >> Thanks! >> Brian >> >> >> Greg Johnson wrote: >>> Hi BZ, >>> I have not had any response to several queries on rxtx and I note >>> others have had the same fate. If you do manage to get rxtx working >>> on a gumstix, I would be indebted if you let me know how. I am now >>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>> small rs232 to socket daemon written by a robotics group who also >>> gave >>> up on rxtx. >>> >>> Good luck! >>> >>> Cheers, >>> greg >>> -------------------------------------------------------------------- >>> ----- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From mm at UDel.Edu Tue Apr 24 06:59:50 2007 From: mm at UDel.Edu (Mike Markowski) Date: Tue, 24 Apr 2007 08:59:50 -0400 Subject: [Rxtx] ints In-Reply-To: References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462DFF46.2080809@udel.edu> Thanks, all, for your the info. This is a glaring shortcoming of the language. I've ended up making a class full of static methods that do what Doug has done below but also for byte, short, and int and conversions from byte[] to unsigned and unsigned to byte[]. Then I just copy it from project to project. I was hoping someone would say this was solved years ago and I just hadn't learned of it. :-) Thanks again, Mike Dr. Douglas Lyon wrote: > Hi All, > Java is a 32 bit machine, so, what image processing people do, > is create a packed 32 bit array of ints for storing their bytes. > Typically it is in the > alpha, red, green, blue, format (i.e., 32 bits per pixel). > Typically this means something like: > public static Image getImage(short r[][], short g[][], short b[][]) { > int w = r.length; > int h = r[0].length; > int pels[] = new int[w * h]; > for (int x = 0; x < w; x++) > for (int y = 0; y < h; y++) > pels[x + y * w] > = 0xFF000000 > | > ((0xFF & r[x][y]) << 16) > | > ((0xFF & g[x][y]) << 8) > | (0xFF & b[x][y]); > return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, > h, > ColorModel.getRGBdefault(), > pels, 0, > w)); > } From Martin.Oberhuber at windriver.com Tue Apr 24 11:04:17 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 24 Apr 2007 19:04:17 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Hello Trent, thanks for your prompt answers! > > I was wondering if you have any newer information > > for when a next official release of RXTX can be > > expected? let me re-word this: how stable do you think is RXTX CVS HEAD compared to 2.1-7r2 ? Is it adviseable to use it, and can we expect that the upcoming version (2.1-8?? or what will it likely be??) is very similar? When approximately can we expect a freeze? What would you think about just labelling CVS HEAD with some name so we get a point in time with a reproducable build? It could be 2.1-8pre1 for instance. > This is YACK in win32termios.h. It prints out the string version of > windows errors. I like having it there for when people try Thanks! -- I tried searching several combinations of letters but missed YACK. If it's just windows, we're fine since stdout is not visible in our product on Windows anyways. > The tough part is deciding how we do it. You have arch, OS, > libc, then people like different configurations. Well, I think that bugzilla makes a good "inbox" for contributions though (even if they are not distributed to the mass from there). I also believe that there are "better" and "worse" configurations. What's most important, is that each configuration is clearly documented how it was built, i.e. what the prerequisites are. That's what I tried to do with the BUILD_INFO.txt file (attached again as sample). It's somehow specified in a GNU arch spec like sparc-sun-solaris8 but this is not detailed enough in some scenarios. > We could probably do this with something like the toolbox Did you mean Toybox? > with default compiles and then a subdir for > custom compiles with a manifest file. Sounds good for me Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BUILD_INFO.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20070424/97bb53f5/attachment-0011.txt From jwright at cornerstonegt.com Tue Apr 24 11:40:07 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Tue, 24 Apr 2007 10:40:07 -0700 Subject: [Rxtx] serial port event listener Message-ID: <462E40F7.8000902@cornerstonegt.com> I recently wrote a simple app that uses rxtx and the serial port event listener in java 5 on mac os x and it seems to work fine. When I port it to linux (CentOS 4, which is binary compatible to Redhat Enterprise 4) the app doesn't work and no events are ever fired (even events 4 & 6 which are generally fired when I startup the app). I am able to start and use the lock, in fact, I'm currently running at root (which will change once I get the port functionality in place). Is there anything different/special that needs to be configured or set up on my linux box to support these events? Am I missing something? Jay From tjarvi at qbang.org Tue Apr 24 19:46:20 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 19:46:20 -0600 (MDT) Subject: [Rxtx] serial port event listener In-Reply-To: <462E40F7.8000902@cornerstonegt.com> References: <462E40F7.8000902@cornerstonegt.com> Message-ID: On Tue, 24 Apr 2007, Jay Wright wrote: > > I recently wrote a simple app that uses rxtx and the serial port event > listener in java 5 on mac os x and it seems to work fine. > > When I port it to linux (CentOS 4, which is binary compatible to Redhat > Enterprise 4) the app doesn't work and no events are ever fired (even > events 4 & 6 which are generally fired when I startup the app). > > I am able to start and use the lock, in fact, I'm currently running at > root (which will change once I get the port functionality in place). > > Is there anything different/special that needs to be configured or set > up on my linux box to support these events? Am I missing something? > I can't think of anything that should be a problem on glibc/Linux with a traditional serial port. Is this a USB dongle or bluetooth? In some cases, these have had incomplete kernel drivers. I think those days have passed though. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 24 20:03:49 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Apr 2007 20:03:49 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848016B4859@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 24 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > thanks for your prompt answers! > >>> I was wondering if you have any newer information >>> for when a next official release of RXTX can be >>> expected? > > let me re-word this: how stable do you think is RXTX > CVS HEAD compared to 2.1-7r2 ? Is it adviseable to > use it, and can we expect that the upcoming version > (2.1-8?? or what will it likely be??) is very similar? > When approximately can we expect a freeze? What would > you think about just labelling CVS HEAD with some > name so we get a point in time with a reproducable > build? It could be 2.1-8pre1 for instance. > I'll put everything into CVS tomorrow that I can. If I have time, I'll fire up the dusty workstation with cross compilers and make some bins. It may be Saturday before I can get bins together - the workstation is in parts right now and I'm teaching evening classes outside of my dayjob. We can discuss code freeze after we see whats in the melting pot. My schedual is not rigid at this point; free time is the issue. I expect the source will be close as is without any major changes and we can let it fester a while for download to find any obvious bugs. One thought I've had about the workstation is I could move that to a network virtual machine service to share the cross compiler environment. It would be more reliable than my outdated hard drives and easier to share and backup. >> We could probably do this with something like the toolbox > > Did you mean Toybox? > yes -- Trent Jarvi tjarvi at qbang.org From peruzzy at gmail.com Wed Apr 25 03:17:50 2007 From: peruzzy at gmail.com (Jose A.) Date: Wed, 25 Apr 2007 11:17:50 +0200 Subject: [Rxtx] sensor wireless & JAVA Message-ID: Hi everybody. I?m working with sensors wireless (Micaz) and I have to use serial port due to I want show datas in a JAVA application. Has anyone worked with sensors wireless and JAVA? I?m using Mantis OS whit the micaZ motes. Thank you. Regards from Spain. From jwright at cornerstonegt.com Wed Apr 25 09:14:15 2007 From: jwright at cornerstonegt.com (Jay Wright) Date: Wed, 25 Apr 2007 08:14:15 -0700 Subject: [Rxtx] serial port event listener In-Reply-To: References: <462E40F7.8000902@cornerstonegt.com> Message-ID: <462F7047.5020000@cornerstonegt.com> Trent Jarvi wrote: > On Tue, 24 Apr 2007, Jay Wright wrote: > >> I recently wrote a simple app that uses rxtx and the serial port event >> listener in java 5 on mac os x and it seems to work fine. >> >> When I port it to linux (CentOS 4, which is binary compatible to Redhat >> Enterprise 4) the app doesn't work and no events are ever fired (even >> events 4 & 6 which are generally fired when I startup the app). >> >> I am able to start and use the lock, in fact, I'm currently running at >> root (which will change once I get the port functionality in place). >> >> Is there anything different/special that needs to be configured or set >> up on my linux box to support these events? Am I missing something? >> > > I can't think of anything that should be a problem on glibc/Linux with a > traditional serial port. Is this a USB dongle or bluetooth? In some > cases, these have had incomplete kernel drivers. I think those days > have passed though. We're using the dongle. After further investigation we've found that when using the serial port event listener, there are a lot of cp2101_ioctl() calls failing. When I read and write to the port io streams directly, we are able to send and receive the proper commands and responses. Our sysadmin is hoping a move to CentOS 5 will help. Any thoughts on why cp2101_ioctl() calls would fail? Jay From tjarvi at qbang.org Wed Apr 25 21:36:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 21:36:28 -0600 (MDT) Subject: [Rxtx] RXTX License link. Message-ID: This should be old news for everyone now but we need to have a formal URL for the RXTX license groups can link. For those needing to link to the RXTX license we discussed, the license is now on rxtx.org and may be linked as follows: http://www.rxtx.org/license.html While it is possible to link to the same file in other ways, the above is all that will be maintained in the case that the project moves to a new server. In short, the license is the LGPL v2.1 with an addition to make implied rights explicit using GNU suggested syntax as the template while modifying it to account for the fact that the library has Java code.. The changes have been discussed on the mail-list and are in the archives. No changes have been made since the discussion - in fact I pulled the text from the mail archives. Combined, this is now version 2.1 of "the RXTX license" and future modifications will have a new version if required. I will be submitting changes to CVS to fix all of the source files and documentation to reflect this shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Apr 25 23:28:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 25 Apr 2007 23:28:41 -0600 (MDT) Subject: [Rxtx] CVS update Message-ID: The license changes are now in rxtx 2.1 CVS. It took a while to go through all of the files. I'll be merging diffs tomorrow or Friday depending upon how classes go. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 30 23:19:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Apr 2007 23:19:23 -0600 (MDT) Subject: [Rxtx] Nice reference to rxtx Message-ID: http://hardware.slashdot.org/hardware/07/05/01/0017244.shtml http://flash-plaice.wikispaces.com/ "JAVA client uses the RXTX serial library with support for 34 platforms including Linux, Windows and Solaris." Nice work folks. Now back to the next release... -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Apr 3 08:48:51 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 03 Apr 2007 10:48:51 -0400 Subject: [Rxtx] rxtx issues Message-ID: Hi All, Marco and I are working on getting RXTX to properly function on a MIPS/ARM system in an ASUS router running the openwrt OS. The crosscompilation produces a library that we can load but are unable to link. >Here is the code: >public class AbsoluteSerialLoader { > public static void main(String[] args) throws >IllegalAccessException, Instan >tiationException { > System.out.println("NativeLib test:"); > > System.loadLibrary("rxtxSerial"); > System.out.println("rxtxSerial loaded!"); > Class aClass = gnu.io.RXTXCommDriver.class; > System.out.println("good, we got the class! "); > CommDriver RXTXDriver = (CommDriver) aClass.newInstance(); > System.out.println("initialize is being called:"); > RXTXDriver.initialize(); > System.out.println("initialized rxtx!"); > } >} >We never loaded: > Class aClass = gnu.io.RXTXCommDriver.class; System.out.println("good, we got the class! "); The output is: >NativeLib test: >rxtxSerial loaded! >[verbose jni: Unable to link native method >Java_gnu_io_RXTXVersion_nativeGetVersion] >[verbose jni: Unable to link native method >Java_gnu_io_RXTXCommDriver_nativeGetVersion] java.lang.UnsatisfiedLinkError: Java_gnu_io_RXTXCommDriver_nativeGetVersion__ My take on this is that we have a library load but that the linking phase is somehow not working properly. Is there someone on this list with RXTX/ARM experience that has a good config for cross compilation? I am Compiling on Fedora 6/x86 but want to target the ARM/OpenWRT with sablevm (i.e. jdk1.4 bytecodes). Thanks! - Doug From gkatz at allot.com Wed Apr 4 04:32:57 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 13:32:57 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Hi all; I have a Samsung CCTV camera I wish to operate remotely via my pc (win xp). I just want a simple script to zoom in/out. On the back, the camera has to wires, one labeled rx and the other tx. I did not get any driver with the camera and I don't even have a clue on how to create a cable with com port to the PC side and to wires only (which ones?) on the other. Can I use RxTx with no supplied driver? Is there some sort of a query API for RxTx to understand the things I can do with the camera? I am totally in the dark here and hope that someone might help me understand what I can/should do? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070404/51b1bba5/attachment-0044.html From joachim at buechse.de Wed Apr 4 05:54:52 2007 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 4 Apr 2007 13:54:52 +0200 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don?t even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Wed Apr 4 05:58:53 2007 From: gkatz at allot.com (Guy Katz) Date: Wed, 4 Apr 2007 14:58:53 +0300 Subject: [Rxtx] [OT] the big picture - can I even use rxtx? References: <05F7777636653C48883BE6FF7FFC64C504DE8F8E@neon.ALLOT.LOCAL> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8F8F@neon.ALLOT.LOCAL> Hi and thanks for the quick reply. Here is the link to the camera. (http://deals2all.zoovy.com/product/SCC-C4202) it states that it is rs-232 compatible so I guess I have at least that... I will try to contact Samsung to get the documentation and take it from there. Thanks for the info. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Joachim Buechse Sent: Wednesday, April 04, 2007 2:55 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [OT] the big picture - can I even use rxtx? I would assume that the camera interface is RS232. Hence the cable is simple. However there is no standard for querying commands from a serial device. Your best bet is to get the developer documentation for the camera from Samsung - it should also include a wiring diagram;-) --- Joachim B?chse Phone: +41 44 500 2604 Buechse Consulting Hadlaubsteig 2 CH-8006 Z?rich On 04.04.2007, at 12:32, Guy Katz wrote: > Hi all; > > I have a Samsung CCTV camera I wish to operate remotely via my pc > (win xp). I just want a simple script to zoom in/out. On the back, > the camera has to wires, one labeled rx and the other tx. I did not > get any driver with the camera and I don't even have a clue on how > to create a cable with com port to the PC side and to wires only > (which ones?) on the other. > > Can I use RxTx with no supplied driver? Is there some sort of a > query API for RxTx to understand the things I can do with the > camera? I am totally in the dark here and hope that someone might > help me understand what I can/should do? > > Thanks in advance. > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx 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 ra85551 at gmail.com Wed Apr 4 09:16:58 2007 From: ra85551 at gmail.com (Pavel Parkhomenko) Date: Wed, 4 Apr 2007 19:16:58 +0400 Subject: [Rxtx] SerialPort.close() takes 30 seconds to complete Message-ID: Hello, world! I've observed very strange behaviour in SerialPort close() method. When I try to close() the port, it doesn't do it immediately, but it tooks exactly 30 seconds. If I try to reopen the port before these 30 seconds pass by, I get an PortInUseException. But if I wait 30 seconds and reopen - all works fine. Does anybody know what might be the reason? -- Pavel Parkhomenko From Steffen.DETTMER at ingenico.com Wed Apr 11 04:07:33 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 11 Apr 2007 12:07:33 +0200 Subject: [Rxtx] Various questions Message-ID: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Hi, I'm very new to rxtx and have questions (yes, I read the wiki pages and looked to the javadocs :)). I'd like to improve the timeout precision but wasn't able to understand the implementation. Java API Questions ------------------ I'm not sure if we use the API correctly. We set a receive timeout for lets say 10 seconds and call the read of the InputStream. IMHO, the Java InputStream and OutputStream interfaces are not suited for communication. Is there another way to use rxtx or is the recommended way through them? The implementation supports a "threshold". In the sources it is documented as "read should return when 'threshold' bytes have been received (or timeout)". If threshold is zero, read seems to return after very small intercharacter timeout I think. Is this correct? I assume this is done in this way to allow the reading application to request more bytes than expected (such as requesting 1024 bytes even if only 20 will arrive) without getting a timeout? But wouldn't this mean to "optimize" an implementation for an incorrect application? But I assume this is a Java weakness inherited from the InputStream usage semantics? If a using application wants e.g. 20 bytes it should set 20 as threshold, is this correct? Is this threshold thing something of that Java communications API? Building Questions ------------------ - How to build the win version? I used the MinGW makefile, but it seems to be buggy. A "make" may link an invalid DLL (native functions are missing), repeating make (after a "manual make clean", because make clean isn't working) after "touch SerialImp.c" seems to workaround this. From the Makefile, I used the CFLAGS that look as for debug (because of TRENT_IS_HERE_DEBUGGING_ENUMERATION) and added some more debug switches (at least -DDEBUG_VERBOSE requires multiple source changes to compile). Makefile dependencies seem to be missing. I assume only cross compiling using automake is maintained? - what are #define asdf and #define TRENT for? The first guards two of three implementations of read_byte_array so I assume it is around old implementations for documentation purposes? Implementation Questions ------------------------ - in windows, I need to call fflush() in report() after fprintf to make output visible (in a cygwin xterm). Otherwise it comes very late in chunks and isn't helpful. - I didn't understand how native code and java "wrapper" code work together. The native code implements e.g. nativeavialable and read_array so at first it seems that it implements the java interface "directly", but RXTXPort.java InputStream is more than just a wrapper, for instance it seems to be responsible for the threshold functionality. Additionally, there are native implementations as "nativeDrain" and the MonitorThread that seems to be the only "event source" in windows (?). - I didn't understand what waitForTheNativeCodeSilly(); and the "monitoring thread" (?) are for. In SerialImp.c finalize_threads() there is some documentation telling a thread is waiting for tcdrain(3) to finish. Why is this done in a thread? OutputStream.write is blocking, isn't it? Is the idea to "write the bytes in the background" after a timeout? - What is SerialImp.cpp for? - in the first finalize_threads implementation in SerialImp.c uses GetTickCount() without checking for overflow. It should be expected that on windows approximately every six weeks overflows (a "while (now-start < timeout)" loop then should be assumed to wait approx 49 days minus timeout, so usually probably 49 days :-)). Additionally, there is "int count" checked against 20 (abitrary value?). What is this about? - termios.c serial_read (under windows) simply blocks on GetOverlappedResult(..., TRUE) - why all that timeout calculation and looping around it? - on windows, regardless of all timeout calculation and handling, according to the debug output the implementation seems only to rely on MonitorThread --> RXTXPort.eventLoop() polling? Why is there a thread needed at all? Any help appreciated :-) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From chenzero at netease.com Thu Apr 12 06:43:37 2007 From: chenzero at netease.com (chenzhelu) Date: Thu, 12 Apr 2007 20:43:37 +0800 (CST) Subject: [Rxtx] strange problem Message-ID: <461E2979.00006D.24873@bjyeahapp2.yeah.net> Hi, when i run the example on the page, http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port i found that the read() function call in SerialReader() is quickly returned and len == 0. is that designated or strange behaviour?whether it can set the timeout value? (the COM port i actually using is "COM1") the version info is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks, chenzero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070412/aa63add1/attachment-0044.html From liujianweione at 163.com Fri Apr 13 04:18:59 2007 From: liujianweione at 163.com (liujianweione) Date: Fri, 13 Apr 2007 18:18:59 +0800 (CST) Subject: [Rxtx] Problem with rxtx2.1.7 porting to arm Message-ID: <7893105.1062861176459539743.JavaMail.root@bj163app13.163.com> Problem with rxtx2.1.7 porting to arm Problem with rxtx2.1.7 porting to arm I tried to port the rxtx library to the platform of armv4l,because I can not find available version in google and this site,(I fail to access to the ftp of Toybox ,could anyone to be so nice to send me a copy,my emailliujianweione at 163.com ) My problem is ,configure like this: /configure --host=arm-linux --target=arm-linux got: ========================================================= WARNING: configure is having a hard time determining which directory contains the file jni_md.h. Edit Makefile and fix the variable JAVANATINC to point to the correct directory. The following options are available: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/ /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/include/linux/ If there are more than one option available the first was selected. ------------------------------------------------------ WARNING: A comm.jar file is already installed make sure your CLASSPATH points to RXTXcomm.jar! /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/comm.jar ------------------------------------------------------ conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant /configure: line 21462: ./conftest: No such file or directory /configure: line 21462: test: 2.6.18-1.2798.fc6: unary operator expected configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands ============================================================== and then make got: ============================================================== 34 problems (34 warnings)/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah -classpath .:/root/work/yizhi/rxtx-2.1-7r2:/root/work/yizhi/rxtx-2.1-7r2/src:/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/ext/RXTXcomm.jar -d arm-unknown-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /root/work/yizhi/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` arm-unknown-linux-gnu/gnu_io_CommPortIdentifier.h: No such file or directory make: *** [/root/work/yizhi/rxtx-2.1-7r2/gnu/io/CommDriver.class] Error 1 by the way I made the x86 compile this afternoon, configure make and got the similar error i686-pc-linux-gnu/gnu_io_CommPortIdentifier.h: No such file could anyone tell me how to fix this problem? ============================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070413/01f8074e/attachment-0044.html From gkatz at allot.com Sun Apr 15 03:37:57 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 12:37:57 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Hi all; I am a web developer finding my self in an odd situation trying to control a security camera and having to deal with bits,bytes and hardware stuff. So, with great humbleness, I ask that maybe someone can take a look and the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which describes the interface to the security camera (the bytes that should be sent) and maybe someone can show me how to code a simple "zoom in" command to the camera. Also, is there suppose to be a return value from such command? Thanks in advance. From jredman at ergotech.com Sun Apr 15 09:33:37 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 09:33:37 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> Message-ID: <462245D1.5070605@ergotech.com> Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From gkatz at allot.com Sun Apr 15 10:01:49 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:01:49 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC2@neon.ALLOT.LOCAL> Thanks Jim! In my wildest dreams I did not expect such an elaborate answer... I am actually doing this for my portal, A Non-commercial, mostly hobby website. The camera will perform a live broadcast of the ocean and will be adjusted from time to time by me (admin) so it is not mission critical. Anyway, I will surely take an in depth look at your mail to try and understand everything. Thanks again for the great help Guy. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From gkatz at allot.com Sun Apr 15 10:43:38 2007 From: gkatz at allot.com (Guy Katz) Date: Sun, 15 Apr 2007 19:43:38 +0300 Subject: [Rxtx] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Jim with you permission I have a final way off topic question. I have noticed that in the back of the camera (per http://img338.imageshack.us/img338/948/2321je9.jpg & http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I need to connect both pin 5 of the rs232 cable & the electricity (DC) ground to the camera GND (ground) input. >From what you guys have experienced in the past, Is this a common case when dealing with such devices? -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Jim Redman Sent: Sunday, April 15, 2007 6:34 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, If this is not a for-fun project and someone is serious about relying on the results from the camera, then I would advise some serious help. There's more to getting the system working than just commands, you need to handle errors, timeouts, etc. etc. Serial interfacing isn't all that complex, but it does help to have a little experience before working on a "critical" system - that is, one where there is any significance to downtime. If you just want to play with the camera, then follow the "send" example from the CommAPI. Set the baud rate, probably to 9600 (according to the page you sent the baud rate should be displayed on the camera screen) set the flow control to none, and the parity to none and stop bits to 1. Then send something like the following (totally untested): int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 checksum = 0xFFFF-checksum; byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; send "toSend" through the output stream, and then read the input stream. IF you've never done anything with serial ports before, I would suggest that before you talk to the camera, you take the wires that are attached to 2 & 3 of the camera and twist them together. If you do this, everything you send will be echoed back to you. This way, you can test your code and that you hit the right pins and make sure that you are writing and reading the serial port correctly before worrying about things like baud rate, parity, correct TX/RX, etc. etc. After you connect to the camera, if nothing happens, first, double check the parameters from the serial port. Then check the cable, if it looks OK, switch the connections to pins 2 & 3 and try again. If still nothing works, buy a serial port monitor that has LEDs on it, and plug it between the computer and the camera and watch for blinking lights. If nothing else, that act of buying it will give you time for some of your frustrations to calm. (Actually, owning one of these should probably be a pre-requisite for downloading code, you don't need it, but it surely saves time on just about every project). If you still don't have anything working after all of this, try asking again. Jim Guy Katz wrote: > Hi all; > I am a web developer finding my self in an odd situation trying to > control a security camera and having to deal with bits,bytes and > hardware stuff. > > So, with great humbleness, I ask that maybe someone can take a look and > the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which > describes the interface to the security camera (the bytes that should be > sent) and maybe someone can show me how to code a simple "zoom in" > command to the camera. > > Also, is there suppose to be a return value from such command? > > Thanks in advance. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Sun Apr 15 11:21:26 2007 From: jredman at ergotech.com (Jim Redman) Date: Sun, 15 Apr 2007 11:21:26 -0600 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <46225F16.4010705@ergotech.com> Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.ch Mon Apr 16 02:36:07 2007 From: joachim at buechse.ch (Joachim Buechse) Date: Mon, 16 Apr 2007 10:36:07 +0200 Subject: [Rxtx] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> Message-ID: <49B5F08C-DDED-4E5A-935F-31186B6D5712@buechse.ch> The cabling is sound, you always need a 0/ground reference in RS232 serial communications. As long as the power supply of your camera is not complete crap it is based on a transformer which decouples the output ground level from the input ground level as a side effect. Additionally most computers have input protection better models use opto-couplers. If you want to be on the safe side, you could also use a good USB2serial adapter - they are usually based on opto-couplers, which will give your computer a nearly 100% protection. Your greater risk is a lightning stroke into the camera... as it will be outdoor, you definetly want to connect its casing to some serious ground cable (min 4mm copper)! If you can't connect it to ground, get yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet + EthernetOverPowerline to be sure that you have no cable running from the camera to the PC. Regards, Joachim On 15.04.2007, at 18:43, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >> From what you guys have experienced in the past, Is this a common >> case > when dealing with such devices? > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start > help > > Guy, > > If this is not a for-fun project and someone is serious about > relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you > need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all > that > > complex, but it does help to have a little experience before > working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" > example > > from the CommAPI. Set the baud rate, probably to 9600 (according > to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits > to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input > stream. > > IF you've never done anything with serial ports before, I would > suggest > that before you talk to the camera, you take the wires that are > attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can > test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double > check > > the parameters from the serial port. Then check the cable, if it > looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't > need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx 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 gkatz at allot.com Mon Apr 16 14:31:39 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 16 Apr 2007 23:31:39 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help References: <20070411100733.GA26383@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FBA@neon.ALLOT.LOCAL> <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Hi all; so unbelieving, i made it the first time!! camera operates through rs323. THANKS FOR THE HELP. only problem now is that when i say 'zoom' and send a single zoom command(frame) to he camera, it zooms all the way instead of a single notch. can this be related to my code? Is there an rs232 generic way to say 'stop' (end of command)? or do you think it a matter of camera configuration? thanks for all the help. P.S: Jim, i crossed the TX RX wires of the rs232 cable before hooking it to the camera to see that i send everything i intend like you said and it really helped. Also, your code worked great(just a few int to byte casts were needed). -----Original Message----- From: rxtx-bounces at qbang.org on behalf of Jim Redman Sent: Sun 4/15/2007 8:21 PM To: RXTX Developers and Users Subject: Re: [Rxtx] sending a command to a camera. need jump start help Guy, Guy Katz wrote: > Jim with you permission I have a final way off topic question. > I have noticed that in the back of the camera (per > http://img338.imageshack.us/img338/948/2321je9.jpg & > http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I > need to connect both pin 5 of the rs232 cable & the electricity (DC) > ground to the camera GND (ground) input. > >>From what you guys have experienced in the past, Is this a common case > when dealing with such devices? I'm not the right person to answer that question. Obviously the camera ground is not isolated from the power supply ground. If the same were true of the computer then you'd essentially be grounding the electrical system through the RS232 ground. (I did have this situation in a house I rented once where the whole house electrical ground was through the outside of the coax Ethernet cable - makes me realize I'm _REALLY_ not the right person for this question). However, perhaps someone with knowledge of electronics, optical isolation, general grounding rules, etc. etc. could provide some better input. I'll be listening too. Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Jim Redman > Sent: Sunday, April 15, 2007 6:34 PM > To: RXTX Developers and Users > Subject: Re: [Rxtx] sending a command to a camera. need jump start help > > Guy, > > If this is not a for-fun project and someone is serious about relying on > > the results from the camera, then I would advise some serious help. > There's more to getting the system working than just commands, you need > to handle errors, timeouts, etc. etc. Serial interfacing isn't all that > > complex, but it does help to have a little experience before working on > a "critical" system - that is, one where there is any significance to > downtime. > > If you just want to play with the camera, then follow the "send" example > > from the CommAPI. Set the baud rate, probably to 9600 (according to the > > page you sent the baud rate should be displayed on the camera screen) > set the flow control to none, and the parity to none and stop bits to 1. > > Then send something like the following (totally untested): > > int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0; //bytes 2-8 > checksum = 0xFFFF-checksum; > byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)}; > > send "toSend" through the output stream, and then read the input stream. > > IF you've never done anything with serial ports before, I would suggest > that before you talk to the camera, you take the wires that are attached > > to 2 & 3 of the camera and twist them together. If you do this, > everything you send will be echoed back to you. This way, you can test > your code and that you hit the right pins and make sure that you are > writing and reading the serial port correctly before worrying about > things like baud rate, parity, correct TX/RX, etc. etc. > > After you connect to the camera, if nothing happens, first, double check > > the parameters from the serial port. Then check the cable, if it looks > OK, switch the connections to pins 2 & 3 and try again. > > If still nothing works, buy a serial port monitor that has LEDs on it, > and plug it between the computer and the camera and watch for blinking > lights. If nothing else, that act of buying it will give you time for > some of your frustrations to calm. (Actually, owning one of these > should probably be a pre-requisite for downloading code, you don't need > it, but it surely saves time on just about every project). > > If you still don't have anything working after all of this, try asking > again. > > Jim > > > Guy Katz wrote: >> Hi all; >> I am a web developer finding my self in an odd situation trying to >> control a security camera and having to deal with bits,bytes and >> hardware stuff. >> >> So, with great humbleness, I ask that maybe someone can take a look > and >> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which >> describes the interface to the security camera (the bytes that should > be >> sent) and maybe someone can show me how to code a simple "zoom in" >> command to the camera. >> >> Also, is there suppose to be a return value from such command? >> >> Thanks in advance. >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5842 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070416/6e0af51f/attachment-0044.bin From Steffen.DETTMER at ingenico.com Tue Apr 17 02:11:05 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 10:11:05 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jump start help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> References: <462245D1.5070605@ergotech.com> <05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL> <46225F16.4010705@ergotech.com> <05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> Message-ID: <20070417081105.GB30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 03:10:06 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 12:10:06 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help References: <462245D1.5070605@ergotech.com><05F7777636653C48883BE6FF7FFC64C504DE8FC4@neon.ALLOT.LOCAL><46225F16.4010705@ergotech.com><05F7777636653C48883BE6FF7FFC64C5897ED0@neon.ALLOT.LOCAL> <20070417081105.GB30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Thanks Steffen; Actually, I have a reader on the input stream that indicates that the camera does not return anything... from what I have seen; a zoom in command will zoom continuously until its limit and vise versa. However, you do have a point about sending another command after the first one. It does cancel the first so I can zoom and stop by calling another command. I think I will try sending a dummy command to stop the camera. Also, can you please explain the DTR toggling thing? Thanks in advance. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 11:11 AM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help * Guy Katz wrote on Mon, Apr 16, 2007 at 22:31 +0200: > only problem now is that when i say 'zoom' and send a single > zoom command(frame) to he camera, it zooms all the way instead > of a single notch. can this be related to my code? The screenshot from the PDF (!) you posted here on sunday has a command 0x20 ("20H") for "Zoom Tele" and a command 0x40 ("40H") for "Zoom Wide". I'd consider the information from the screenshot as ... not really sufficient for programing. IMHO, Jim did a really great job creating the example toSend[] - without it I didn't understood those spec tables lol. (BTW, Jim, did you used a crystal sphere for spec predicting? :)) is an response returned? If so, when beginning to zoom or when it is finished? What happens if you sent another command "quickly" (let's say 20-100 ms after the zoom or so), maybe an "enter" or just a 0x00 or even an invalid command, just guessing. Is there a working windows/whatever/binary demo? Then you could use a nullmodem cable to see what this tool is sending (could be more difficult if responses are involved). ohh, or maybe there is a manual explaining this... happy hacking :) > Is there an rs232 generic way to say 'stop' (end of command)? > or do you think it a matter of camera configuration? what would a 'stop' tell let's say a modem? ;) Modems like to use DTR toggling for reset - maybe try out what your camera is doing on DTR toggling (try "on, 500 ms delay, off" or so). > thanks for all the help. > > P.S: Jim, i crossed the TX RX wires of the rs232 cable before > hooking it to the camera to see that i send everything i intend > like you said and it really helped. Also, your code worked > great(just a few int to byte casts were needed). Ahh, yes, in java 0xA0 is not a byte because a byte is signed, yes, no joke (what a luck that java has no "bit", probably it also would be signed lol SCNR) oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Steffen.DETTMER at ingenico.com Tue Apr 17 04:30:11 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 17 Apr 2007 12:30:11 +0200 Subject: [Rxtx] [CONTINUED] sending a command to a camera. need jumpstart help In-Reply-To: <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> References: <20070417081105.GB30818@elberon.bln.de.ingenico.com> <05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> Message-ID: <20070417103010.GE30818@elberon.bln.de.ingenico.com> * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From gkatz at allot.com Tue Apr 17 04:47:12 2007 From: gkatz at allot.com (Guy Katz) Date: Tue, 17 Apr 2007 13:47:12 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C504DE8FD6@neon.ALLOT.LOCAL> Hi; Actually, I havn't tried dummy yet, I only tried zoom and break the zoom by focus command. I will try using a dummy and let you know. Thanks for all the help. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steffen DETTMER Sent: Tuesday, April 17, 2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPor t.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long ) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From lists at brianz.org Tue Apr 17 13:31:41 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 12:31:41 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <4625209D.608@brianz.org> Hello all, I'm trying to use Rxtx on a gumstix computer and can't seem to get Rxtx to build. I see that someone else has had this exact problem in this thread: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20070409/1037809.html ...but there are no follow-ups. I get a jar file which I've successfully used on OS X and Windows with prebuilt binaries, but none of the arm binaries I've found work (segmentation faults). Can anyone offer some advice or help? BZ From lists at brianz.org Tue Apr 17 15:14:05 2007 From: lists at brianz.org (Brian Z) Date: Tue, 17 Apr 2007 14:14:05 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> Message-ID: <4625389D.8090402@brianz.org> Wow, that really is a shame. From what I've found, Rxtx is the only free alternative besides javacomm which isn't an alternative for the ARM architecture. I assume Trent reads these messages. Trent, is there anything you can add to this thread....even "Rxtx won't support ARM" would be helpful. :>) Thanks! Brian Greg Johnson wrote: > Hi BZ, > I have not had any response to several queries on rxtx and I note > others have had the same fate. If you do manage to get rxtx working > on a gumstix, I would be indebted if you let me know how. I am now > pursuing the use of "serialdaemon gumstix" (google it) which is a > small rs232 to socket daemon written by a robotics group who also gave > up on rxtx. > > Good luck! > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 From tjarvi at qbang.org Wed Apr 18 07:08:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:08:14 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: <4625389D.8090402@brianz.org> References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: RXTX should work on ARM. I've not tested it but I have compiled binaries. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 The problem is people want various libc combinations such as uclibc. These should work but I do not have time right now to provide those. The support really is determined by your efforts with ARM. On Tue, 17 Apr 2007, Brian Z wrote: > Wow, that really is a shame. From what I've found, Rxtx is the only > free alternative besides javacomm which isn't an alternative for the ARM > architecture. > > I assume Trent reads these messages. Trent, is there anything you can > add to this thread....even "Rxtx won't support ARM" would be helpful. :>) > > Thanks! > Brian > > > Greg Johnson wrote: >> Hi BZ, >> I have not had any response to several queries on rxtx and I note >> others have had the same fate. If you do manage to get rxtx working >> on a gumstix, I would be indebted if you let me know how. I am now >> pursuing the use of "serialdaemon gumstix" (google it) which is a >> small rs232 to socket daemon written by a robotics group who also gave >> up on rxtx. >> >> Good luck! >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Apr 18 07:30:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Apr 2007 07:30:47 -0600 (MDT) Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: Sure. We could add that to the ToyBox tree. I could also give him permission to upload new versions. On Wed, 18 Apr 2007, Greg Johnson wrote: > If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? > It would make life easier for those of us trying to get it running. > > Cheers, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > > On 18 Apr 2007, at 15:08, Trent Jarvi wrote: > >> >> RXTX should work on ARM. I've not tested it but I have compiled binaries. >> >> ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 >> >> The problem is people want various libc combinations such as uclibc. These >> should work but I do not have time right now to provide those. >> >> The support really is determined by your efforts with ARM. >> >> >> On Tue, 17 Apr 2007, Brian Z wrote: >> >>> Wow, that really is a shame. From what I've found, Rxtx is the only >>> free alternative besides javacomm which isn't an alternative for the ARM >>> architecture. >>> >>> I assume Trent reads these messages. Trent, is there anything you can >>> add to this thread....even "Rxtx won't support ARM" would be helpful. :>) >>> >>> Thanks! >>> Brian >>> >>> >>> Greg Johnson wrote: >>>> Hi BZ, >>>> I have not had any response to several queries on rxtx and I note >>>> others have had the same fate. If you do manage to get rxtx working >>>> on a gumstix, I would be indebted if you let me know how. I am now >>>> pursuing the use of "serialdaemon gumstix" (google it) which is a >>>> small rs232 to socket daemon written by a robotics group who also gave >>>> up on rxtx. >>>> >>>> Good luck! >>>> >>>> Cheers, >>>> greg >>>> ------------------------------------------------------------------------- >>>> Greg Johnson >>>> Research Fellow at University of Manchester >>>> Scientific Collaborator at ESRF - European Synchrotron >>>> greg.johnson at esrf.fr >>>> greg.johnson at ieee.org >>>> +33 (0)4 76 88 28 37 >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> > From Martin.Oberhuber at windriver.com Wed Apr 18 10:21:00 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 18 Apr 2007 18:21:00 +0200 Subject: [Rxtx] Rxtx for ARM (gumstix) Message-ID: <460801A4097E3D4CA04CC64EE648584801541935@ism-mail03.corp.ad.wrs.com> Hello, Talking about new builds and the ToyBox, I have uploaded a build of rxtx-2.1-7r2 for sparc-sun-solaris7 that works without libgcc_s.so and is thus much more portable than what there is in the rxtx-bins package. My contribution is attached to http://bugzilla.qbang.org/show_bug.cgi?id=73 Please consider uploading to the ToyBox and/or replacing it in the bins package. BTW, is the RXTX bugzilla still active? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From lists at brianz.org Wed Apr 18 10:56:44 2007 From: lists at brianz.org (Brian Z) Date: Wed, 18 Apr 2007 09:56:44 -0700 Subject: [Rxtx] Rxtx for ARM (gumstix) In-Reply-To: References: <4625209D.608@brianz.org> <1EC0CEF4-5AE3-44B5-9B8B-42B613F6C47F@manchester.ac.uk> <4625389D.8090402@brianz.org> Message-ID: <46264DCC.60804@brianz.org> I managed to build rxtx last night and successfully tested it on my Gumstix. Ultimately I'd like to add this to the Gumstix buildroot. In the meantime, I'd be more than happy to upload the binary somewhere. Brian Trent Jarvi wrote: > Sure. We could add that to the ToyBox tree. I could also give him > permission to upload new versions. > > On Wed, 18 Apr 2007, Greg Johnson wrote: > > >> If Brian Z agreed, perhaps his gumstix binary could be added to the Toybox? >> It would make life easier for those of us trying to get it running. >> >> Cheers, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> From Martin.Oberhuber at windriver.com Fri Apr 20 07:32:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 20 Apr 2007 15:32:53 +0200 Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? Message-ID: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Hello Trent, I was wondering if you have any newer information for when a next official release of RXTX can be expected? For our internal usage, I did recompile rxtx-2.1-7r2 on Solaris and Linux. I remembered that you had mentioned a YUCC macro in order to disable debug info, but I did not find this anywehere in the sources. Was this only added after 2.1-7 or did I mishear you? The other thing I wanted to know is, if the RXTX bugzilla is still active. I uploaded my rebuild for Solaris there and added two other bugs (not being able to compile with jdk-1.2.2 and Zystem.java not being compatible with jdk-1.2.2). My Eclipse Plugins are also making progress and are in an almost perfect shape now. Only thing missing is a better releng process for automatically building the complete update site and downloadables. I did not see my previous submission uploaded anywhere -- did you plan doing that, or should I make a new submission on bugzilla, where I can actually upload as an attachment myself? Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From Steffen.DETTMER at ingenico.com Fri Apr 20 07:51:32 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 20 Apr 2007 15:51:32 +0200 Subject: [Rxtx] bug in rxtxSerial.dll timeout handling Message-ID: <20070420135132.GA25978@elberon.bln.de.ingenico.com> Hi, I think I found a bug in rxtxSerial.dll timeout handling. This may cause that a read takes more time than requested. The needed additional time can be up to the time requested in worst case (leading to a read call that takes approximately twice the specified time). Any comments are appreciated. First let me describe what happens. After this, I tell the workaround I use, in case it helps someone else until a fix is avilable. Please note, that I'm unable to understand the implementation. I don't understand why asynchronous (overlapping) I/O with windows native functions (ReadFile) but ALSO some termios-Functions are "emulated" and additionally some polling thread exists. I would think that simply synchronous win I/O should be sufficient to do synchronous I/O, but probably there is some trick for some old windows versions or so, who knows. Because of this, I may be very wrong with my "analysing" :) Now I try to describe the problem: Let's assume a read of 5172 ms is intended. Someone would call port_.enableReceive Timeout(5172) resulting in internal calls (SerialImp.c and termios.c): tcgetattr: VTIME:51, VMIN:0 c_cc[VTIME] = 51, c_cc[VMIN] = 0 A systematic rounding error happens (between 1 and 99 ms). Later, a read function gets called by read_byte_array (it is serial_read). The timeout is not passed, but serial_read takes it from VTIME: ReadTotalTimeoutConstant: 5100 .... 5100 ms later ... size > 0: spent=5110 have=5100 You see, serial_read worked as expected. But now in read: read_byte_array: while ( 0 < 1 && 2 < 20) exp 5125 < timeout 5172 because of the rounding the timeout is not expired ("exp" for elapsed [expired time] is smaller than the timeout). What happens is another (second) call to serial_read: entering serial_read(1) now serial_read again waits 5100 ms because c_cc[VTIME] is still 51 resulting again in size > 0: spent=5110 have=5100 TO leaving serial_read but this is wrong, because the left timeout was only 47 ms (5172 - 5125). read_byte_array: while ( 0 < 1 && 3 < 20) exp 10250 < timeout 5172 RXTXPort:readArray: 1 0 leaving RXTXPort:readArray RXTXPort:SerialInputStream:read(1024 0 1024) returned 0 bytes In total, 10250 milliseconds of 5172 elapsed... so by this, a big timeout precision problem was created: 3 14:35:12 20/Apr/07 30 (Rs232Connection doConcreteRead): read(b, 0, 1024) = 0 3 14:35:12 20/Apr/07 31 (Timer getTimeSinceExpired): Timer expired (at 14:35:07.778, now is 14:35:12.872). Since expired = 5094 ms ? 14:35:12 20/Apr/07 32 (Rs232Connection doConcreteRead): Bad Rx timeout precision: late for more than 100 ms (5094 > 100) an error of 5094 ms in this case. The problem is a combination of rounding errors, "global variables" (the value in tcgetattr) and a mix of used technologies (tcgetattr as "variable" plus GetTickCount as timer, ...), that's why I think it is maybe not that easy to fix. Now a potential workaround (in client java code using a release lib, because building the rxtx libs is non-trivial). In short, call enableReceiveTimeout and read in a loop with the left timeout up to let's say 10 seconds with timeout dividable by 100 without any rest (i.e. "timeout % 100 == 0"). In more detail: As Arien wrote a few weeks ago, that the for longer timeouts the timing precision seems to decrease, so first part is to loop the inputstream.read() method with a timeout smaller than 10 seconds (abitrary value). In this java code, you need a incremental timer around of course. Well, when working with InputStreams best is having a crystal sphere and a magic wand ready, because that API simply su..^W ... well, other topic. Some pseudo code illustrating the idea: public void read( byte[] buffer, int bufsize ) throws CommException { Timer timer = new Timer(timeout); try { // loop while remaining bytes and timeout not expired do { bytesRequested = bufsize - totalBytesRead; // set port receive timeout limited to 10 seconds { long receiveTimeout = timer.getCurrentLeftTimeout(); if (receiveTimeout > 10000) { rs232Logger_.finest("limiting long timeout " + receiveTimeout + " ms to 9800 ms"); receiveTimeout = 9800; // give 200 ms for overheads } setReceiveTimeout(receiveTimeout); } bytesRead = port_.getInputStream().read( buffer, totalBytesRead, bytesRequested ); timer.updateCurrentTimeout(bytesRead > 0); } while (!timeouts.isTimedout() && (totalBytesRead < bufsize)); } catch (IOException e) { // handle } } setReceiveTimeout has a workaround for the rounding/call-again problem: // so internally it is stored as in tenth of seconds. // so we make it modulo 100 to avoid differences. { intTimeout = ( intTimeout / 100 ) * 100; // 0 would disable, so let's take 100 :) if (intTimeout <= 0) { intTimeout = 100; } } port_.enableReceiveTimeout(intTimeout); (this is simplified a lot, the original file has more than 700 lines of code, so don't try to copy&paste :)). Hope it helps. oki, Steffen // Modeline for VIM. Please don't remove. // (Help: autoindent, expandtab, shiftwidth=4, tabstop=4, textwidth=75) // vi: set ai et sw=4 ts=4 tw=75: About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Fri Apr 20 08:56:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 20 Apr 2007 08:56:33 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I just wanted to let you know I'm itching to get to this and get it done. I've had family in town from out of state and could not get away for the last 9 days. They leave Saturday. I'll post a reply to you and the news group later. I wont say tonight but it may be tonight. On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From lhy0yhl at sohu.com Fri Apr 20 22:06:34 2007 From: lhy0yhl at sohu.com (lhy0yhl) Date: Sat, 21 Apr 2007 12:06:34 +0800 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 Message-ID: <200704211206330316768@sohu.com> My machineType is X86_64-suse-Linux, My JDK is 1.5.0. I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at test.Test.getAvaliablePorts(Test.java:18) at test.Test.getPorts(Test.java:122) at test.Test.main(Test.java:128) I have follow the instructions about how to use Rxtx under Linux. 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. I login on as root. Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. lhy0yhl 2007-04-21 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070421/5cb125f8/attachment-0035.html From j.kenneth.gentle at acm.org Sat Apr 21 17:52:02 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Sat, 21 Apr 2007 19:52:02 -0400 Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: <200704212354.l3LNsCmw013504@qbang.org> As a guess, either jdk1.5.0 or librxtxSerial.so is not compatible with the 64 bit environment. There should be specific 32 and 64 bit downloads of Java - don't know if there is a 64 bit RXTX, but I'd think it wouldn't be too hard to build. Ken At 00:06 2007-04-21, you wrote: > >My machineType is X86_64-suse-Linux, My JDK is 1.5.0. >I have test my app under windows using Rxtx, and it has passed. But >when I move it to Linux-Suse-10, I found the Exception when the app start: > >java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: >ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver >Exception in thread "main" java.lang.UnsatisfiedLinkError: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: >/usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > >I have follow the instructions about how to use Rxtx under Linux. >1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; >2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here >the $ARCH is i386, but I am not sure about this configure. > >I login on as root. > >Would any one kindly resolve this for me? Thanks very much. I have >been trapped on this problem for several days. It really feels terrible. > > >---------- >lhy0yhl >2007-04-21 >_______________________________________________ >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/20070421/91a81659/attachment-0044.html From tjarvi at qbang.org Sat Apr 21 18:26:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 21 Apr 2007 18:26:18 -0600 (MDT) Subject: [Rxtx] Agent Problem: wrong ELF class: ELFCLASS64 In-Reply-To: <200704211206330316768@sohu.com> References: <200704211206330316768@sohu.com> Message-ID: On Sat, 21 Apr 2007, lhy0yhl wrote: > > My machineType is X86_64-suse-Linux, My JDK is 1.5.0. > I have test my app under windows using Rxtx, and it has passed. But when I move it to Linux-Suse-10, I found the Exception when the app start: > > java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 thrown while loading gnu.io.RXTXCommDriver > Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: /usr/java/jdk1.5.0/jre/lib/i386/librxtxSerial.so: wrong ELF class: ELFCLASS64 > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at test.Test.getAvaliablePorts(Test.java:18) > at test.Test.getPorts(Test.java:122) > at test.Test.main(Test.java:128) > > I have follow the instructions about how to use Rxtx under Linux. > 1. Copy the Rxtxcomm.jar into my /$JAVA_HOME/jre/lib/ext; > 2. Copy the librxtxSerial.so into my /$JAVA_HOME/jre/lib/$ARCH, here the $ARCH is i386, but I am not sure about this configure. > > I login on as root. > > Would any one kindly resolve this for me? Thanks very much. I have been trapped on this problem for several days. It really feels terrible. It looks like you have a 32 bit JRE installed. You need to match rxtx with your JRE arch. -- Trent Jarvi tjarvi at qbang.org From arnab.bhaumik at gmail.com Sun Apr 22 02:16:37 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 22 Apr 2007 17:16:37 +0900 Subject: [Rxtx] parallel port with rxtx Message-ID: hi all, this is arnab bhaumik from kolkata, india. i am an embeded system developer. i used rxtx package for my past two projects for serial communicstion. currently i have to access the parallel port. please let me know that can i access paralles port correctly using rxtx? all api for the parallel port is implimented?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070422/611f9e66/attachment-0044.html From tjarvi at qbang.org Sun Apr 22 12:46:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 22 Apr 2007 12:46:03 -0600 (MDT) Subject: [Rxtx] parallel port with rxtx In-Reply-To: References: Message-ID: On Sun, 22 Apr 2007, arnab bhaumik wrote: > hi all, > > this is arnab bhaumik from kolkata, india. i am an embeded system > developer. i used rxtx package for my past two projects for serial > communicstion. > > currently i have to access the parallel port. please let me know that > can i access paralles port correctly using rxtx? all api for the parallel > port is implimented?? > Not all of the API is implemented. It should allow reading and writing but some of the more involved functions are stubs. You can look at ParallelImp.c to decide if it is enough, you would like to implement a missing part or if it is just not what you wanted. -- Trent Jarvi tjarvi at qbang.org From gkatz at allot.com Mon Apr 23 01:24:34 2007 From: gkatz at allot.com (Guy Katz) Date: Mon, 23 Apr 2007 10:24:34 +0300 Subject: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help References: <20070417081105.GB30818@elberon.bln.de.ingenico.com><05F7777636653C48883BE6FF7FFC64C504DE8FD3@neon.ALLOT.LOCAL> <20070417103010.GE30818@elberon.bln.de.ingenico.com> Message-ID: <05F7777636653C48883BE6FF7FFC64C5897ED2@neon.ALLOT.LOCAL> I would like to thank this list for the great help i got here (specificaly Jim & Steffen). I got everything working in no time with your help. thanks. Guy. ________________________________ From: rxtx-bounces at qbang.org on behalf of Steffen DETTMER Sent: Tue 4/17/2007 1:30 PM To: RXTX Developers and Users Subject: Re: [Rxtx] [CONTINUED] sending a command to a camera. needjumpstart help * Guy Katz wrote on Tue, Apr 17, 2007 at 12:10 +0300: > However, you do have a point about sending another command after the > first one. It does cancel the first so I can zoom and stop by calling > another command. > I think I will try sending a dummy command to stop the camera. cool! > > try "on, 500 ms delay, off" or so (should be off, delay, on) > Also, can you please explain the DTR toggling thing? Sure, here is a diagram: ---+ +--------------------------- | | | | +---+ SCNR. http://en.wikipedia.org/wiki/Rs232#Signals http://java.sun.com/products/javacomm/reference/api/javax/comm/SerialPort.html#setDTR(boolean) http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long) or try http://www.google.com/ or http://search.yahoo.com/ or so to find a web search engine :) Well, if sending a dummy command works, no need to influence DTR at all. Usually you should set DTR at start (or it is already set by the OS or so) and keep it on all the time. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/fba4dd1f/attachment-0044.html From mm at UDel.Edu Mon Apr 23 05:22:48 2007 From: mm at UDel.Edu (Mike Markowski) Date: Mon, 23 Apr 2007 07:22:48 -0400 Subject: [Rxtx] Slightly OT: Java and unsigned ints Message-ID: <462C9708.2000205@udel.edu> I expect more people in this group than elsewhere have run up against Java's lack of unsigned integers. The technique I've been using to get around this is to put them into integers and mask off the sign extension. This is awkward to say the least & I wonder if there are better ways of dealing with it or even if there have been Java language developments I'm just not aware of? By the way, I've been successfully using rxtx for a couple months in a ham radio project at http://udel.edu/~mm/ham/elecraft/ . (Source code isn't up there yet because it's changing too quickly still.) Thanks! Mike From Steffen.DETTMER at ingenico.com Mon Apr 23 05:56:12 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 23 Apr 2007 13:56:12 +0200 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <462C9708.2000205@udel.edu> References: <462C9708.2000205@udel.edu> Message-ID: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: > I expect more people in this group than elsewhere have run up > against Java's lack of unsigned integers. The technique I've > been using to get around this is to put them into integers and > mask off the sign extension. mask by bitwise? Is this needed? For "bytes", I usually write: byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask needed, but still not so nice. For me, logically, a byte has a range from 0 to 0xff, not from -128 to 127 or so :-) > This is awkward to say the least & I wonder if there are better > ways of dealing with it or even if there have been Java > language developments I'm just not aware of? Yes, I'd also like to learn about a more comfortable way if any. oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From lyon at docjava.com Mon Apr 23 07:54:16 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 23 Apr 2007 09:54:16 -0400 Subject: [Rxtx] ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: Hi All, Java is a 32 bit machine, so, what image processing people do, is create a packed 32 bit array of ints for storing their bytes. Typically it is in the alpha, red, green, blue, format (i.e., 32 bits per pixel). Typically this means something like: public static Image getImage(short r[][], short g[][], short b[][]) { int w = r.length; int h = r[0].length; int pels[] = new int[w * h]; for (int x = 0; x < w; x++) for (int y = 0; y < h; y++) pels[x + y * w] = 0xFF000000 | ((0xFF & r[x][y]) << 16) | ((0xFF & g[x][y]) << 8) | (0xFF & b[x][y]); return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, ColorModel.getRGBdefault(), pels, 0, w)); } Which looks really awful, IMHO. Yet this type of code is typical. Your basic 32 bit machine wants locality in access in order to take advantage of 32 bit vector processor units and cache memory. Many of the shift and multiply operations can be done in parallel on a super-scalar processor...so it is not as inefficient as it may seem at first blush. Still, it is not pretty. - Doug >* Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension.? > >mask by bitwise? Is this needed? For "bytes", I usually write: > >byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; > >or so. Then ahex(bytes).equalsIgnoreCase("03F00FAB") - no mask >needed, but still not so nice. For me, logically, a byte has a >range from 0 to 0xff, not from -128 to 127 or so :-) > >> This is awkward to say the least & I wonder if there are better >> ways of dealing with it or even if there have been Java >> language developments I'm just not aware of? > >Yes, I'd also like to learn about a more comfortable way if any. > >oki, > >Steffen > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >About Ingenico Throughout the world businesses >rely on Ingenico for secure and expedient >electronic transaction acceptance. Ingenico >products leverage proven technology, established >standards and unparalleled ergonomics to provide >optimal reliability, versatility and usability. >This comprehensive range of products is >complemented by a global array of services and >partnerships, enabling businesses in a number of >vertical sectors to accept transactions anywhere >their business takes them. >www.ingenico.com This message may contain >confidential and/or privileged information. If >you are not the addressee or authorized to >receive this for the addressee, you must not >use, copy, disclose or take any action based on >this message or any information herein. If you >have received this message in error, please >advise the sender immediately by reply e-mail >and delete this message. Thank you for your >cooperation. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Mon Apr 23 08:33:01 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Mon, 23 Apr 2007 16:33:01 +0200 Subject: [Rxtx] Cant read on COM on Windows XP Message-ID: <462CC39D.3010305@stueken.de> Hi, I try to change from Sun Comm to RXTX but without success. I try version RXTX-2.1-7. I can open the SerialPort, set params and write out to port. But I didn't get any byte from serial port. portIdentifier = CommPortIdentifier.getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(new SerialListener()); serialPort.notifyOnDataAvailable(true); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); isInited = true; // test read for(;;) getLogger().info( inputStream.read()); The test read always return -1. When I change back the import to "javax.comm.*" it works fine. The write to outputStream works fine. I dont know why the reading doesn't work. Any suggestions ? regards -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070423/29f55ff4/attachment-0012.vcf From j.kenneth.gentle at acm.org Mon Apr 23 08:47:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 23 Apr 2007 10:47:05 -0400 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <462CC39D.3010305@stueken.de> References: <462CC39D.3010305@stueken.de> Message-ID: <200704231447.l3NElBOa002857@qbang.org> Known issue on windows - "read()" on the input stream doesn't block. You have to either set a timeout (I personally am using Integer.MAX_VALUE), or use the "notification" or "event" mechanism to wait for bytes to read. None are really pleasant, but either will work. I started looking at the C for a fix, but quickly realized how out-of-practice I am at multi-platform "ifdef'd" C! Ken At 10:33 2007-04-23, you wrote: >Hi, >I try to change from Sun Comm to RXTX but without success. I try >version RXTX-2.1-7. I can open the SerialPort, set params and write >out to port. But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = > portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); > >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. >I dont know why the reading doesn't work. Any suggestions ? > >regards > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From jredman at ergotech.com Mon Apr 23 09:16:57 2007 From: jredman at ergotech.com (Jim Redman) Date: Mon, 23 Apr 2007 09:16:57 -0600 Subject: [Rxtx] Slightly OT: Java and unsigned ints In-Reply-To: <20070423115612.GZ13933@elberon.bln.de.ingenico.com> References: <462C9708.2000205@udel.edu> <20070423115612.GZ13933@elberon.bln.de.ingenico.com> Message-ID: <462CCDE9.1020609@ergotech.com> Steffen, Steffen DETTMER wrote: > * Mike Markowski wrote on Mon, Apr 23, 2007 at 07:22 -0400: >> I expect more people in this group than elsewhere have run up >> against Java's lack of unsigned integers. The technique I've >> been using to get around this is to put them into integers and >> mask off the sign extension. > > mask by bitwise? Is this needed? For "bytes", I usually write: > > byte[] bytes = new byte[] { 0x03, (byte)0xF0, (byte)0x0F, (byte)0xab }; There's still a problem if you want to, say, checksum this array. int checksum = 0; for ( int counter = 0 ; counter < bytes.length ; counter++ ) { checksum += bytes[counter]; } will give you the wrong checksum because 0xab and 0xF0 will be sign extended. You need: checksum += (bytes[counter] & 0xFF); To get the correct result. This ,as was originally observed, is ugly, but I know of no better way. I am prepared to be educated if anyone has a prettier solution. I was going to raise this issue in connection with the camera, but in that case it made no difference. (That might always be true if the checksum is one byte, someone with greater knowledge of number theory can perhaps say whether this is the case). The problem is much worse when dealing with unsigned longs. Bytes, shorts and ints you can represent as unsigned with the next longer type, but longs you have no where to go except a BigInteger. BigInteger manipulation is clumsy and in the end you probably need to get back to a 64 bit entity to encode it on the wire. The lack of unsigned types in Java is a problematic (at least for us) in byte-by-byte protocols. That, and you end up with a lot of code that looks like BASIC - ugh! Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Mon Apr 23 19:32:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Apr 2007 19:32:38 -0600 (MDT) Subject: [Rxtx] RXTX: New version, YUCC macro, Bugzilla, Eclipse-plugins? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848015AD48A@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 20 Apr 2007, Oberhuber, Martin wrote: > Hello Trent, > > I was wondering if you have any newer information > for when a next official release of RXTX can be > expected? > > For our internal usage, I did recompile rxtx-2.1-7r2 > on Solaris and Linux. I remembered that you had > mentioned a YUCC macro in order to disable debug > info, but I did not find this anywehere in the > sources. Was this only added after 2.1-7 or did > I mishear you? This is YACK in win32termios.h. It prints out the string version of windows errors. I like having it there for when people try various kernel drivers that represent themselves as COM objects but may not be serial ports underneath. "I was using a bluetooth ..." > > The other thing I wanted to know is, if the RXTX > bugzilla is still active. I uploaded my rebuild > for Solaris there and added two other bugs (not > being able to compile with jdk-1.2.2 and Zystem.java > not being compatible with jdk-1.2.2). Bugzilla is active for bug reports. People do close bugs in bugzilla. I do review the bugs about twice a year. I also get bug notifications which I could have sent to this list - they are low volume. For fixes, we usually use the mail-list. For binaries, we need something else. qbang.org is not a good ftp fileserver - thats related to ftp and router issues. What may make sense is to convert the ftp over to a http server and then give contributors write access. The tough part is deciding how we do it. You have arch, OS, libc, then people like different configurations. We could probably do this with something like the toolbox with default compiles and then a subdir for custom compiles with a manifest file. Once we know what we are doing, I can set it up in an evening. Suggestions are welcome. For the Eclipse related downloads, we can handles those slightly differently to make sure they have sufficient download capacity. > > My Eclipse Plugins are also making progress and > are in an almost perfect shape now. Only thing > missing is a better releng process for automatically > building the complete update site and downloadables. > I did not see my previous submission uploaded > anywhere -- did you plan doing that, or should I > make a new submission on bugzilla, where I can > actually upload as an attachment myself? Yes. I'll procmail that out of my inbox and put it up. I need to update the license info too. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From dirk.niemeier at stueken.de Tue Apr 24 01:34:27 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Tue, 24 Apr 2007 09:34:27 +0200 Subject: [Rxtx] Cant read on COM on Windows XP In-Reply-To: <200704231447.l3NElBOa002857@qbang.org> References: <462CC39D.3010305@stueken.de> <200704231447.l3NElBOa002857@qbang.org> Message-ID: <462DB303.70104@stueken.de> Thanks Ken for answer, but this is not the really problem. I tried to work with EventListener but this doesn't get any event from serial port anytime. The problem is, that the routine didn't get any data. The "//test read" comment isn't my real getData funktionality. I tried out "enableReceiveTimeout(Integer.MAX_VALUE)". This blocks the read method (40sec), but didn't get any data. And with javax.comm.* it works. And I doen't have any spezific Hardware. regards, Dirk Ken Gentle schrieb: > Known issue on windows - "read()" on the input stream doesn't block. > > You have to either set a timeout (I personally am using > Integer.MAX_VALUE), or use the "notification" or "event" mechanism to > wait for bytes to read. None are really pleasant, but either will work. > > I started looking at the C for a fix, but quickly realized how > out-of-practice I am at multi-platform "ifdef'd" C! > > Ken > > At 10:33 2007-04-23, you wrote: > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read >> for(;;) >> getLogger().info( inputStream.read()); >> >> The test read always return -1. When I change back the import to >> "javax.c