« Adding a column to an existing RRD database...Video Card ATI HD3300 »

Configuring the Serial port for the Javelin Terminal

17/04/09 | par jmspaggi [mail] | Catégories: Javelin

Javelin terminal is sending information on an RS-232 protocol, but at 28800 bauds. This is not a standard rate and you migh face some troubles to configure it under Linux.

I wasted 2 days searching how to make it works, so here is the result.

First you have to configure your serial port to be at 115200, but with a divisor at 4. So 4 * 28 800 = 115300.

This is done by:
setserial /dev/ttyS0 baud_base 115200 spd_cust divisor 4
Then I used stty to configure the port, but since after I'm using java to read the data, I'm not 100% sur if it's require.

However, the line is:
stty -F /dev/ttyS0 38400

Then on the Java side, using javax.comm API, set the port with:
serialPort.setSerialPortParams(38400, SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);

And that's all. Simply use the javax.comm example (SimpleRead.java) and update it with your needs.

JM




Permalink

Aucun commentaire pour le moment

April 2019
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        

Statistiques

Free counter and web stats

Search

XML Feeds

powered by b2evolution