Skip to contentSkip to conversation

serial device access from welcome script

DISCUSSION Thilo Riessner 5 participants 9 messages Sep 6, 2006 – Sep 13, 2006 PPP protocol drivers and compressors

lore
Share & tools
lore
#0 lore raw

From a program called by the welcome script which tries to access the serial port (in this case /dev/ttyI0) I get the errormessage:
Port or socket open error!
I guess, that the serial port is blocked by the pppd.
Is there any possibility to access the serial port nevertheless? Thanks for any help

Thilo

#1 lore raw

From a program called by the welcome script which tries to access the serial port (in this case /dev/ttyI0) I get the errormessage:
Port or socket open error!
I guess, that the serial port is blocked by the pppd.
Is there any possibility to access the serial port nevertheless? Thanks for any help

Thilo

#2 lore raw
In reply to Thilo Riessner
Quoted 5 lines · Thilo Riessner
Quoted 1 line

From a program called by the welcome script which tries to access the serial

port (in this case /dev/ttyI0) I get the errormessage:
Port or socket open error!
I guess, that the serial port is blocked by the pppd. Is there any possibility to access the serial port nevertheless?

You shouldn't be trying to access the port directly. Instead, when the "welcome" script runs, your script's standard input and standard output are connected directly to the tty.

You should be able to use 'read' and 'echo' (or whatever your scripting language supports) without having to open anything.

This is true for "connect", "disconnect", "init", and "pty" as well.

Signature · 1 line
James Carlson         42.703N 71.076W         <[email protected]>
#3 lore raw
In reply to Thilo Riessner

Have you removed the "lock" option from your ppp options file (/etc/ppp/options)?

Quoted 12 lines
Quoted 1 line

From a program called by the welcome script which tries to access the serial

port (in this case /dev/ttyI0) I get the errormessage:
Port or socket open error!
I guess, that the serial port is blocked by the pppd. Is there any possibility to access the serial port nevertheless? Thanks for any help

Thilo
-
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to Thilo Riessner
Quoted 3 lines · Pieter Loubser

Have you removed the "lock" option from your ppp options file (/etc/ppp/options)?

The "lock" option only creates UUCP advisory lock files; it doesn't actually prevent access to the serial port.

Signature · 1 line
James Carlson         42.703N 71.076W         <[email protected]>
#5 lore raw
In reply to Thilo Riessner

Am Mittwoch, 6. September 2006 23:53 schrieben Sie:

Quoted 9 lines
Quoted 7 lines · Thilo Riessner
Quoted 2 lines

From a program called by the welcome script which tries to access the serial

port (in this case /dev/ttyI0) I get the errormessage:
Port or socket open error!
I guess, that the serial port is blocked by the pppd. Is there any possibility to access the serial port nevertheless?

Quoted 8 lines

You shouldn't be trying to access the port directly. Instead, when the "welcome" script runs, your script's standard input and standard output are connected directly to the tty.

You should be able to use 'read' and 'echo' (or whatever your scripting language supports) without having to open anything.

This is true for "connect", "disconnect", "init", and "pty" as well.

Thanks for your hint, but I have the problem, that the program (which is a binary program) I am running out of my welcome script (which is a bash script) does not support the usage of stdin and stdout, but it demands the usage of a device for reading and writing. Is there a trick that I could use in the welcome script to redirect stdin and stdout to a "device" and use that device in the program, which is called from the welcome script.

#6 lore raw
In reply to Thilo Riessner

Use the files /dev/stdin and /dev/stdout

Quoted 28 lines · Thilo Riessner

Am Mittwoch, 6. September 2006 23:53 schrieben Sie:

Quoted 9 lines
Quoted 7 lines · Thilo Riessner
Quoted 2 lines

From a program called by the welcome script which tries to access the serial

port (in this case /dev/ttyI0) I get the errormessage:
Port or socket open error!
I guess, that the serial port is blocked by the pppd. Is there any possibility to access the serial port nevertheless?

Quoted 8 lines

You shouldn't be trying to access the port directly. Instead, when the "welcome" script runs, your script's standard input and standard output are connected directly to the tty.

You should be able to use 'read' and 'echo' (or whatever your scripting language supports) without having to open anything.

This is true for "connect", "disconnect", "init", and "pty" as well.

Thanks for your hint, but I have the problem, that the program (which is a binary program) I am running out of my welcome script (which is a bash script) does not support the usage of stdin and stdout, but it demands the usage of a device for reading and writing. Is there a trick that I could use in the welcome script to redirect stdin and stdout to a "device" and use that device in the program, which is called from the welcome script. -
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
In reply to Thilo Riessner

The program needs one device for reading and writing. Therefore the /dev/stdin and /dev/stdout is not usable. Or do I get something wrong there?

Quoted 37 lines

Use the files /dev/stdin and /dev/stdout

Quoted 19 lines · Thilo Riessner

Am Mittwoch, 6. September 2006 23:53 schrieben Sie:

Quoted 9 lines
Quoted 7 lines · Thilo Riessner
Quoted 2 lines

From a program called by the welcome script which tries to access the serial

port (in this case /dev/ttyI0) I get the errormessage:
Port or socket open error!
I guess, that the serial port is blocked by the pppd. Is there any possibility to access the serial port nevertheless?

Quoted 8 lines

You shouldn't be trying to access the port directly. Instead, when the "welcome" script runs, your script's standard input and standard output are connected directly to the tty.

You should be able to use 'read' and 'echo' (or whatever your scripting language supports) without having to open anything.

This is true for "connect", "disconnect", "init", and "pty" as well.

Quoted 10 lines

Thanks for your hint, but I have the problem, that the program (which is a binary program) I am running out of my welcome script (which is a bash script) does not support the usage of stdin and stdout, but it demands the usage of a device for reading and writing. Is there a trick that I could use in the welcome script to redirect stdin and stdout to a "device" and use that device in the program, which is called from the welcome script. -
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

-
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
In reply to Thilo Riessner
Quoted 3 lines · Thilo Riessner

The program needs one device for reading and writing. Therefore the /dev/stdin and /dev/stdout is not usable. Or do I get something wrong there?

???? reading=/dev/stdin, writing=/dev/stdout. ???

Also a device or whatever can in general be opened for both reading and writing.

Quoted 34 lines
Quoted 34 lines

Use the files /dev/stdin and /dev/stdout

Quoted 29 lines · Thilo Riessner

Am Mittwoch, 6. September 2006 23:53 schrieben Sie:

Quoted 9 lines
Quoted 7 lines · Thilo Riessner
Quoted 2 lines

From a program called by the welcome script which tries to access the serial

port (in this case /dev/ttyI0) I get the errormessage:
Port or socket open error!
I guess, that the serial port is blocked by the pppd. Is there any possibility to access the serial port nevertheless?

Quoted 8 lines

You shouldn't be trying to access the port directly. Instead, when the "welcome" script runs, your script's standard input and standard output are connected directly to the tty.

You should be able to use 'read' and 'echo' (or whatever your scripting language supports) without having to open anything.

This is true for "connect", "disconnect", "init", and "pty" as well.

Thanks for your hint, but I have the problem, that the program (which is a binary program) I am running out of my welcome script (which is a bash script) does not support the usage of stdin and stdout, but it demands the usage of a device for reading and writing. Is there a trick that I could use in the welcome script to redirect stdin and stdout to a "device" and use that device in the program, which is called from the welcome script. -
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html