OpenWrt Forum Archive

Topic: Send data to TP-Link TL-WR741ND?

The content of this topic has been archived on 16 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello
I want to establish 2-way communication between my PC and TP-Link TL-WR741ND router.
I can send from the router to my PC using command:
echo -e -n "\x9B ....." /dev/ttyS0
and it works fine.
Now I want to send data from my PC and receive it on my Router
I tried cat but doesn't work:

stty 115200 < /dev/ttyS0 #Set the baud rate
cat /dev/ttyS0 > a.txt  #Copy the received data from ttyS0 to file a.txt

Any suggestions?

(Last edited by eng.hassan23 on 4 Mar 2012, 13:50)

Hello
I found that setserial and stty are not supported on my device. How to enable them?
Backfire 10.03.1
Thanks

stty in package "coreutils"
setserial in package "setserial"

I am newbie,
How to install these two packages? smile

I installed the packages and I receive data but wrong...strange symbols
Are these configurations correct?

stty 115200 cs8 -parenb -cstopb sane -echo -echok -icrnl -ixon -icanon -opost -onlcr time 1 min 0 < /dev/ttyS0

root@OpenWrt:~# setserial -a /dev/ttyS0
/dev/ttyS0, Line 0, UART: 16550A, Port: 0x0000, IRQ: 11
        Baud_base: 10937500, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test

root@OpenWrt:~# stty -F /dev/ttyS0
speed 115200 baud; line = 0;
min = 0; time = 1;
-icrnl
-opost -onlcr
-icanon -echo -echok

**********

What is baud_base?

Devices Specs:
Baud Rate: 115200
I send HEX Data
8 bits, one stop bit, no parity

Thanks

root@OpenWrt:~# stty -a
speed 38400 baud; rows 24; columns 80; 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; 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
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

Hey can you post your codes after it started to work? would be much appreciated smile

The discussion might have continued from here.