guys,i have a problem sending command through terminal to the serial port. i’ve already set the baudrate, start bit,data bits, stop bit, and parity bit using stty command. now i just have to send few 8bits data (0xF5,0x01,0x00,0x01,0x03,0x01,0x03,0xF5) to the the external device but it just wont work. below is my serial port setting

root@ubuntu:~# stty -a </dev/ttyUSB0 speed 19200 baud; rows 0; columns 0; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; swtch = ; start = ^A; stop = ^A; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8 opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

and this is how i sent my data in terminal which result in nothing. please help me guys,i’m so desperate right now! T.T. and 1 more thing is i need to read replies data from the device. any idea?

echo -e '\F5\01\00\01\03\00\03\F5\' >/dev/ttyUSB0

p/s: i’ve used cutecom software and it works perfectly but i dont want to use any software. If possible i want to use only the terminal alone. please please please help me.

Erm, how about a little ‘c’ code ?? Something like;
[disclaimer :: this is very rough and does no error checking, but it works]

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>

extern int errno;

void main()
	char buffer[128];
	int out = open("/dev/tty2",O_WRONLY);
	int inp = open("/dev/tty2",O_RDONLY);
	sprintf(buffer,"Enter your name: ");
	printf("You typed [%s]\n",buffer);

Sample run;

initctl stop tty2
# ./term
++F2 (type "MadPenguin") +
You typed [MadPenguin]

Obviously you’d swap “tty2” with your device of choice … (USB0?)
[you can call an stty routine first in the code if necessary]

Compile the code with;

gcc term.c -o term 
(assuming you name the above file "term.c")

i’m thinking of using only the old-style terminal if possible. is there any other way? to configure the baudrate,databits,parity bits, and start/stop bit just by using old-style terminal?

Erm, as per the other thread …

The thing that presents the login prompt is “getty”.
To configure the login prompt for a serial console, you need an entry in /etc/init to match the device in question.
(/etc/init/usb0 ??)

You set the serial port options as part for the “exec” “getty” line in this file (!)