From: James K. <jwk...@gm...> - 2020-10-25 16:31:43
|
Corgi, I can run your check-out script and it works for me, but I can't seem to get RXTX to read data from the port. By chance did you write a check-out for reading data? Jim K. Houston TX ///////////////////////////////////////////////////////////////////////// #Jython.py Serial Port connection with RXTX import sys, socket, gnu.io import gnu.io.RXTXPort as RXTX #Open port COM3 portId=gnu.io.CommPortIdentifier.getPortIdentifier("COM3") serialPort=portId.open("Demo1",2000) #(Name,delay) #Set port parameters serialPort.setSerialPortParams(9600,RXTX.DATABITS_8,RXTX.STOPBITS_1,RXTX.PARITY_NONE) #Open input & output streams outStream=serialPort.getOutputStream() inStream=serialPort.getInputStream() #Define some output and write it to the serial port toOutput="Test output to serial port" outStream.write(toOutput) #Close inStream, outStream before closing the port itself outStream.close() inStream.close() serialPort.close() |