0

I am trying to read the output stream from a GPS chip, attached to my computer via a USB cable, using the RXTX API.

My Java reads

sp.setSerialPortParams(4800, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);

My app currently outputs Scanning port /dev/tty.Bluetooth-Incoming-Port

So I believe my Bluetooth port is number 4800?

Running ls /dev/tty.*gives /dev/tty.usbserial only when the GPS is plugged in, so this is my device. I also see the Bluetooth device.

So I think I need to change the number in my Java code - how do I get the usbserial device number?

Ben Mayo
  • 1,285
  • 2
  • 20
  • 37
  • 4800 is the baudrate - your gps-usb-connection seems to have internally an usb<-->serial adapter. I cant tell you where the serial port would be mapped, when i used an usb<-->serial adapter it was port COM4 (on an windows machine).... but it might me linked to somewhere else on your computer... – Martin Frank Jan 30 '14 at 13:34
  • when your serial port is really /dev/tty.usbserial you can create an serial port with rxtx on that port; once you created that serial port you can simply read from that port like you would read from an ... ...socket ...or any other stream – Martin Frank Jan 30 '14 at 13:38
  • 4800 is the baudrate - thanks Martin, another piece of the puzzle fits into place. – Ben Mayo Jan 30 '14 at 18:17
  • Hello Ben, i used to work with RXTX, if i can assiste in any way let me know! - btw RXTX rocks!!!! – Martin Frank Jan 30 '14 at 18:40
  • Hi Martin, _only if_ you have a spare moment, I have a follow up question here http://stackoverflow.com/questions/21466396/java-marine-api-looking-for-nmea-data. Perhaps your expertise is relevant, thank you for your assistance so far. – Ben Mayo Jan 30 '14 at 20:19

0 Answers0