I have a serial device connected to pi´s USB slot. The device is detected in ttyUSB0. Aten uc232a usb to serial adapter is used between the serial device and pi. I have to run a read and write operation to the serial device. I used rxtx library for this. The java application is inspired from the following link. http://eclipsesource.com/blogs/2012/10/17/serial-communication-in-java-with-raspberry-pi-and-rxtx/

The machine has baud rate 38400. The application runs with incorrect output when baud rate is set to 19200. With baud rate set to 38400 the application gives error

gnu.io.unsupportedcommoperationexception:Invalid Parameter at RXTXPort.setSerialPortParams

  • Can you try changing machine's baud rate to 19200? – Tolga Varol Aug 17 '15 at 15:25
  • 1
    It seems that the library you are using does not support 38400. You will have to find another library if that is the only baud rate your application will accept. Of course your call may be wrong but we need to see the code to see if that is the case. – joan Aug 17 '15 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.