Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

echange données via Port serie.

5 réponses
Avatar
patrice
Bonjour,
dans le cadre la mise en oeuvre du cluster heartbeat, je dois avoir une
connexion via port serie entre les 2 machines.
Cependant, cette connexion semble muette depuis ma recompilation de
kernel ... et je n ai plus les ancien point config pour tester quelle
modif peut avoir engendrer ce pbs....a force de vouloir trop optimiser,
j avais oublier deretester ce parametre. :-(
Bref, voici ma demarche...merci de me dire si j ai oublier qqch a mois q
cela sois dans les option d'ip table que je doivent rajouter qqch (pour
le moment j ai juste posotionner le masquerade afin de permettre le NAT )

Voici ce que je fais sur les 2 serveurs

1/presence port serie
cat /proc/ioports |grep serial =
03f8-03ff : serial
2/sur serveur a
echo toto >/dev/ttyS0

sur serveur b
cat /dev/ttyS0

==> normalement je devrais avoir toto qui apparais sur b ---> mais rien

3/ allons plus loin
strace -e write, open echo "toto" >/dev/ttyS0
write(2, "Couldnt get a file descriptor re"..., 55Couldnt get a file
descriptor
referring to the console
) = 55
write(2, "Could not get a file descriptor "..., 57Could not get a file
descripto
r referring to the console
) = 57
patrice@MURPHY:~$ strace -e write, open echo "toto" >/dev/ttyS0
write(2, "Couldnt get a file descriptor re"..., 55Couldnt get a file
descriptor
referring to the console
) = 55
write(2, "Could not get a file descriptor "..., 57Could not get a file
descripto
r referring to the console
) = 57

==> je ne sais pas comment interpreter cela ...peut etre que la reponse
est la ?

4/voici ce que j ai activer ds le kernel afin d avoir les port serie
d'activer...peut etre manque til qqch ?

character device ->serial drivers
input device->hardware i/o port->serial port line
network devices support-> SLIP
I2c-> show serial bus
SPI

Merci de votre aide... je vais continuer a investiguer mais la je ne
sais plus ou vraiement donné de la tete ....

5 réponses

Avatar
Nicolas George
patrice wrote in message <45177d2b$0$4772$:
strace -e write, open echo "toto" >/dev/ttyS0


Ça ne fait pas ce que tu crois : tu es en train de stracer la commande open.
Il ne faut pas d'espace après la virgule. D'autre part, même corrigé comme
ça, tu ne verras pas l'ouverture de ttyS0, parce qu'elle est faite par le
shell avant l'exécution de strace. Il faut faire quelque chose comme :

strace -e write,open sh -c "echo toto > /dev/ttyS0"

Avatar
patrice
ok
mais je ne dechiffre pas mieux :-(


# strace -e write,open sh -c "echo toto > /dev/ttyS0"
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libncurses.so.5", O_RDONLY) = 3
open("/lib/tls/libdl.so.2", O_RDONLY) = 3
open("/lib/tls/libc.so.6", O_RDONLY) = 3
open("/dev/tty", O_RDWR|O_NONBLOCK|O_LARGEFILE) = 3
open("/etc/mtab", O_RDONLY) = 3
open("/proc/meminfo", O_RDONLY) = 3
open("/dev/ttyS0", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3
write(1, "toton", 5)


#MURPHY:~# strace sh -c "echo toto > /dev/ttyS0"
execve("/bin/sh", ["sh", "-c", "echo toto > /dev/ttyS0"], [/* 14 vars
*/]) = 0
uname({sys="Linux", node="MURPHY", ...}) = 0
brk(0) = 0x80e6000
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb7f66000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size4770, ...}) = 0
old_mmap(NULL, 34770, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f5d000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/libncurses.so.5", O_RDONLY) = 3
read(3, "177ELF111331220342"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size%2592, ...}) = 0
old_mmap(NULL, 257868, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7f1e000
old_mmap(0xb7f54000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x35000) = 0xb7f54000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/tls/libdl.so.2", O_RDONLY) = 3
read(3, "177ELF11133132032"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size˜72, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb7f1d000
old_mmap(NULL, 8632, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7f1a000
old_mmap(0xb7f1c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x2000) = 0xb7f1c000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/tls/libc.so.6", O_RDONLY) = 3
read(3, "177ELF111331`Z100"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size54660, ...}) = 0
old_mmap(NULL, 1264972, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7de5000
old_mmap(0xb7f0f000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x129000) = 0xb7f0f000
old_mmap(0xb7f18000, 7500, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f18000
close(3) = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f1db80,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0xb7f5d000, 34770) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
open("/dev/tty", O_RDWR|O_NONBLOCK|O_LARGEFILE) = 3
close(3) = 0
brk(0) = 0x80e6000
brk(0) = 0x80e6000
brk(0x80e7000) = 0x80e7000
brk(0) = 0x80e7000
brk(0x80e8000) = 0x80e8000
getuid32() = 0
getgid32() = 0
geteuid32() = 0
getegid32() = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
time(NULL) = 1159172702
brk(0) = 0x80e8000
brk(0x80e9000) = 0x80e9000
brk(0) = 0x80e9000
brk(0x80ea000) = 0x80ea000
open("/etc/mtab", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, , ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb7f65000
read(3, "/dev/sda1 / ext3 rw,errors=remou"..., 4096) = 407
close(3) = 0
munmap(0xb7f65000, 4096) = 0
open("/proc/meminfo", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb7f65000
read(3, "MemTotal: 508424 kBnMemFre"..., 1024) = 598
close(3) = 0
munmap(0xb7f65000, 4096) = 0
brk(0) = 0x80ea000
brk(0x80eb000) = 0x80eb000
rt_sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
rt_sigaction(SIGQUIT, {SIG_IGN}, {SIG_DFL}, 8) = 0
uname({sys="Linux", node="MURPHY", ...}) = 0
stat64("/root", {st_mode=S_IFDIR|0755, st_size24, ...}) = 0
stat64(".", {st_mode=S_IFDIR|0755, st_size24, ...}) = 0
getpid() = 5730
getppid() = 5729
stat64(".", {st_mode=S_IFDIR|0755, st_size24, ...}) = 0
stat64("/usr/local/sbin/sh", 0xbfe44e30) = -1 ENOENT (No such file or
directory)
stat64("/usr/local/bin/sh", 0xbfe44e30) = -1 ENOENT (No such file or
directory)
stat64("/usr/sbin/sh", 0xbfe44e30) = -1 ENOENT (No such file or
directory)
stat64("/usr/bin/sh", 0xbfe44e30) = -1 ENOENT (No such file or
directory)
stat64("/sbin/sh", 0xbfe44e30) = -1 ENOENT (No such file or
directory)
stat64("/bin/sh", {st_mode=S_IFREG|0755, st_sizeb5228, ...}) = 0
stat64("/bin/sh", {st_mode=S_IFREG|0755, st_sizeb5228, ...}) = 0
getpgrp() = 5729
rt_sigaction(SIGCHLD, {0x8076f20, [], 0}, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
open("/dev/ttyS0", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3
fcntl64(1, F_GETFD) = 0
fcntl64(1, F_DUPFD, 10) = 10
fcntl64(1, F_GETFD) = 0
fcntl64(10, F_SETFD, FD_CLOEXEC) = 0
dup2(3, 1) = 1
close(3) = 0
write(1, "toton", 5) = 5
dup2(10, 1) = 1
fcntl64(10, F_GETFD) = 0x1 (flags FD_CLOEXEC)
close(10) = 0
exit_group(0) = ?
MURPHY:~#


patrice wrote in message <45177d2b$0$4772$:

strace -e write, open echo "toto" >/dev/ttyS0



Ça ne fait pas ce que tu crois : tu es en train de stracer la commande open.
Il ne faut pas d'espace après la virgule. D'autre part, même corrigé comme
ça, tu ne verras pas l'ouverture de ttyS0, parce qu'elle est faite par le
shell avant l'exécution de strace. Il faut faire quelque chose comme :

strace -e write,open sh -c "echo toto > /dev/ttyS0"



Avatar
Nicolas George
patrice wrote in message <451792e3$0$26922$:
open("/dev/ttyS0", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3
fcntl64(1, F_GETFD) = 0
fcntl64(1, F_DUPFD, 10) = 10
fcntl64(1, F_GETFD) = 0
fcntl64(10, F_SETFD, FD_CLOEXEC) = 0
dup2(3, 1) = 1
close(3) = 0
write(1, "toton", 5) = 5


Ça a l'air de plutôt bien marcher, le problème n'est probablement pas là.


Merci de poster à l'endroit.

Avatar
patrice
patrice wrote in message <451792e3$0$26922$:

open("/dev/ttyS0", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3
fcntl64(1, F_GETFD) = 0
fcntl64(1, F_DUPFD, 10) = 10
fcntl64(1, F_GETFD) = 0
fcntl64(10, F_SETFD, FD_CLOEXEC) = 0
dup2(3, 1) = 1
close(3) = 0
write(1, "toton", 5) = 5



Ça a l'air de plutôt bien marcher, le problème n'est probablement pas là.




Merci de poster à l'endroit.
j ai tester en bootant sur 2 live cd et cela fonctionne...au moins je

suis sur que cela ne vient pas du materiel
je ne vois pas du tt ce qui me manques
je suis bloquer et je ne sais plus comment faire...je lis le how-to
serial ports mais j ai lu trucs qui parler de udev et des peripherique
qui etait vu non plus en /dev/ttyS* mais en /dev/ttys/* ....
pourtant j'ai bien /dev/ttyS0 sur les 2 machines...


Avatar
patrice
bonjour suite a une recompil du 2.6, je n'arrive plus a ecrire d'un tty
a un autre via un cable null modem
quelles sont option du kernel a configurer pour que cela fionctionne a
nouveau?

character device ->serial drivers
input device->hardware i/o port->serial port line
network devices support-> SLIP
I2c-> show serial bus
SPI

Merci de votre aide... je vais continuer a investiguer mais la je ne
sais plus ou vraiement donné de la tete ....