I've a cash drawer attached to my system via RJ11 cable in /dev/ttyS4. I'm trying to send an echo command to trigger the cash drawer using:
echo -e "\x07" > /dev/ttyS4
I observed that the terminal hangs for around ~ 10-15 seconds and eventually the echo command comes out.
I remember seeing this command worked earlier on the same system.
The following is the serial port settings from
[ 1.424083] 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A [ 1.445149] 00:04: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A [ 1.466208] 00:05: ttyS2 at I/O 0x3e8 (irq = 5, base_baud = 115200) is a 16550A [ 1.487268] 00:06: ttyS3 at I/O 0x2e8 (irq = 10, base_baud = 115200) is a 16550A [ 1.508361] 00:07: ttyS4 at I/O 0x2f0 (irq = 5, base_baud = 115200) is a 16550A [ 1.529427] 00:08: ttyS5 at I/O 0x2e0 (irq = 10, base_baud = 115200) is a 16550A
$ sudo stty -F /dev/ttyS4 -a speed 9600 baud; rows 0; columns 0; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 5; -parenb -parodd -cmspar 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 -flusho -extproc
Has any one faced similar issue ?
Since it worked earlier, could it be due to any changes in the serial port configuration ?
As another test, I wrote a simple serial port C program to send a command to /dev/ttyS4, but even in that case, I found that similar hang happens even in this case.
Could someone please help me to understand what could be the issue behind this ?