What steps will reproduce the problem?
1. java version "1.7.0_60" and jssc 2.8 release
2. raspberry pi using debian watchport/h sensor
3. execution of the following code
public static void main(String[] args) {
SerialPort serialPort = new SerialPort("/dev/ttyUSB0");
try {
System.out.println("Port opened: " + serialPort.openPort());
System.out.println("Params setted: " + serialPort.setParams(9600, 8, 1, 0));
System.out.println("Request for temperature sent " + serialPort.writeBytes("\rT\r".getBytes()));
System.out.println("temperature is : "+new String(serialPort.readBytes(10)));
System.out.println("Port closed: " + serialPort.closePort());
}
catch (SerialPortException ex){
System.out.println(ex);
}
}
When run for the first time, the code prints out the temperature and closes the
port. Any runs after that hang on "Request for temperature sent", as the
readBytes after it never completes. Only remedy was to physically remove usb
cable and plug it back in, then it will read out the temperature, but again,
only once. I've used minicom to check out the connection, it works every time,
so the cables and the connection are ok.
If i connect the sensor to the PC running debian, the code will get me the
temperature every time, no problems there.
Original issue reported on code.google.com by lordm...@gmail.com on 11 Aug 2014 at 12:08
Original issue reported on code.google.com by
lordm...@gmail.com
on 11 Aug 2014 at 12:08