View previous topic :: View next topic |
Author |
Message |
CRV§ADER//KY Guru


Joined: 30 Aug 2004 Posts: 405 Location: Torino
|
Posted: Thu Oct 07, 2004 5:30 pm Post subject: I/O su seriale? |
|
|
Come faccio a trasmettere dati sulla porta seriale RS232?
Ho attaccato un cavo null modem a 3 fili (testato) alla COM1 e alla COM2 del mio pc.
# stty -F /dev/ttyS0
speed 57600 baud; line = 0;
-brkint -imaxbel
# stty -F /dev/ttyS1
speed 57600 baud; line = 0;
-brkint -imaxbel
poi apro un secondo terminale e digito
# cat /dev/ttyS1
dal primo terminale, lancio
# cat > /dev/ttyS0
hello world
linea 2
questo è quel che vedo sul secondo terminale:
# cat /dev/ttyS1
h
l
come risolvo? l'obbiettivo finale è di riuscire a
1)mandare direttamente dei pacchetti .tar da un PC all'altro
2)stabilire una connessione TCP-IP
mi serve per uno scassatissimo portatile Pentium 100 che non dispone di altri dispositivi di I/O.
Grazie in anticipo _________________ Kyrie, Ignis Divine, Eleison ~ Elfen Lied
Last edited by CRV§ADER//KY on Thu Oct 07, 2004 9:05 pm; edited 1 time in total |
|
Back to top |
|
 |
xxchris n00b

Joined: 07 Oct 2004 Posts: 23
|
|
Back to top |
|
 |
CRV§ADER//KY Guru


Joined: 30 Aug 2004 Posts: 405 Location: Torino
|
Posted: Thu Oct 07, 2004 8:35 pm Post subject: |
|
|
L'ho letto con molto interesse.... ma ne so quanto prima
Il problema è che a me NON funziona il test più semplice di tutti, ossia "echo hello > /dev/ttyS0"
# stty -F /dev/ttyS0 -a
speed 57600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <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 _________________ Kyrie, Ignis Divine, Eleison ~ Elfen Lied |
|
Back to top |
|
 |
xxchris n00b

Joined: 07 Oct 2004 Posts: 23
|
Posted: Thu Oct 07, 2004 8:39 pm Post subject: |
|
|
inizia ad abbassare la velocita... (ad es 9600)
ciao _________________ while true...Gentoo |
|
Back to top |
|
 |
CRV§ADER//KY Guru


Joined: 30 Aug 2004 Posts: 405 Location: Torino
|
Posted: Thu Oct 07, 2004 8:42 pm Post subject: |
|
|
xxchris wrote: | inizia ad abbassare la velocita... (ad es 9600)
ciao |
Ci ho già provato. E cmq il cavo che sto usando è ampiamente testato a 57600. _________________ Kyrie, Ignis Divine, Eleison ~ Elfen Lied |
|
Back to top |
|
 |
xxchris n00b

Joined: 07 Oct 2004 Posts: 23
|
Posted: Thu Oct 07, 2004 9:00 pm Post subject: |
|
|
domanda semplice...
forse hai digitato male nel primo post...
TERMINALE1
echo "CIAO" > /dev/ttyS0
TERMINALE2
cat /dev/ttyS1
o non ho capito io...  _________________ while true...Gentoo |
|
Back to top |
|
 |
CRV§ADER//KY Guru


Joined: 30 Aug 2004 Posts: 405 Location: Torino
|
Posted: Thu Oct 07, 2004 9:04 pm Post subject: |
|
|
xxchris wrote: | domanda semplice...
forse hai digitato male nel primo post...
TERMINALE1
echo "CIAO" > /dev/ttyS0
TERMINALE2
cat /dev/ttyS1
o non ho capito io...  |
no, è giusto. sto provando con la COM1 e la COM2 dello stesso PC, con un cavo esterno che le collega. _________________ Kyrie, Ignis Divine, Eleison ~ Elfen Lied |
|
Back to top |
|
 |
CRV§ADER//KY Guru


Joined: 30 Aug 2004 Posts: 405 Location: Torino
|
Posted: Thu Oct 07, 2004 9:07 pm Post subject: |
|
|
quel che è peggio è che non arriva sempre e soltanto la prima lettera: talvolta arriva la prima lettera; talvolta la prima lettera ripetuta 2-200 volte, talvolta nono arriva un bel niente. _________________ Kyrie, Ignis Divine, Eleison ~ Elfen Lied |
|
Back to top |
|
 |
xxchris n00b

Joined: 07 Oct 2004 Posts: 23
|
Posted: Thu Oct 07, 2004 10:28 pm Post subject: |
|
|
mmm
ho riprovato poco fa e a me funzionava tutto.
Ho controllato con stty ed erano settate a 9600.
non hai un altro pc in giro con cui provare?
(si lo so...richiesta assurda :S) _________________ while true...Gentoo |
|
Back to top |
|
 |
CRV§ADER//KY Guru


Joined: 30 Aug 2004 Posts: 405 Location: Torino
|
Posted: Thu Oct 07, 2004 10:35 pm Post subject: |
|
|
xxchris wrote: | mmm
ho riprovato poco fa e a me funzionava tutto. |
mi posti l'output di
stty -F /dev/ttyS0 -a
per favore? thx _________________ Kyrie, Ignis Divine, Eleison ~ Elfen Lied |
|
Back to top |
|
 |
xxchris n00b

Joined: 07 Oct 2004 Posts: 23
|
Posted: Thu Oct 07, 2004 10:47 pm Post subject: |
|
|
eccolo
Code: |
lyra root # stty -F /dev/ttyS0 -a
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <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
|
ciao _________________ while true...Gentoo |
|
Back to top |
|
 |
CRV§ADER//KY Guru


Joined: 30 Aug 2004 Posts: 405 Location: Torino
|
Posted: Mon Oct 11, 2004 4:33 pm Post subject: |
|
|
xxchris wrote: | eccolo
ciao |
aaargh! ma è identico al mio!
*va a sbattere la testa contro il muro non sapendo più che pesci pigliare* _________________ Kyrie, Ignis Divine, Eleison ~ Elfen Lied |
|
Back to top |
|
 |
|