Professional Web Applications Themes

How can I send a break to a remote machine? - Sun Solaris

Hello, I am trying to send a break to a remote machine from a Sun machine. Normally with tip I enter <CR>~# to send a break And you get the ok prompt when the remote machine is in the boot sequence for example. (This is equivalent to the STOP A when you boot up.) Note that break is not a character but a signal (DTR goes to ground). But I need to send it from a shell script. Note that tip is only interactive. What are the solutions to send a break to the remote machine? Thanks...

  1. #1

    Default How can I send a break to a remote machine?

    Hello,

    I am trying to send a break to a remote machine from a Sun machine.
    Normally with tip I enter <CR>~# to send a break
    And you get the ok prompt when the remote machine is in the boot
    sequence for example. (This is equivalent to the STOP A when you boot
    up.)

    Note that break is not a character but a signal (DTR goes to ground).

    But I need to send it from a shell script. Note that tip is only
    interactive.

    What are the solutions to send a break to the remote machine?

    Thanks
    sbriet@hotmail.com Guest

  2. #2

    Default Re: How can I send a break to a remote machine?

    On 26 Sep 2003, com wrote:
     

    Either run tip from "expect", or write your own little C
    program to send a break, and call that from your script.

    --
    Rich Teer, SCNA, SCSA

    President,
    Rite Online Inc.

    Voice: +1 (250) 979-1638
    URL: http://www.rite-online.net

    Rich Guest

  3. #3

    Default Re: How can I send a break to a remote machine?

    com wrote: 

    I think it has to be done with the serial line (or keyboard which
    we know will also send a break). So remotely you need to get
    access to a device that connects in one of those ways (I think, though
    I've never done it with a keyboard outside of the keyboard itself).
    Even if the program is "interactive".. you can always use something
    like expect to drive it. Usually not needed though.

    I have many Sun boxes connected to Cyclades TS series switches...
    from there I can send any box a break (can define what a break
    sequence is as well).

    Off the top of my head... someone may know how to do this w/o
    something this direct.

    Chris Guest

  4. #4

    Default Re: How can I send a break to a remote machine?

    com (com) writes: 

    Sorry, that's not correct. None of the RS232 signals go to ground
    state (0 Volts) unless power has been turned off. The only valid
    states for RS232 are +12V and -12V (and RS423 is +5V and -5V).

    A break signal is when the machine on switches its Transmit Data pin
    from negative to positive voltage for the period of time it takes to
    send three characters. At 9600 bps, that's about 3-4 milliseconds.
    Break signals happen on the data pins, not the control pins like DTR.
     

    Shell scripts are very poor tools for controlling any interactive
    program like ones that talk through RS232 ports.

    Use a program that has a scripting language, like Kermit. Write a
    script in that language that sends the break at the time you want.
    That's the right tool for the job.

    -Greg
    --
    Do NOT reply via e-mail.
    Reply in the newsgroup.
    Greg Guest

  5. #5

    Default Re: How can I send a break to a remote machine?

    com <com> wrote: 
     
     
     

    1) You can change a sun machine's serial abort sequence from an RS-232
    BREAK to a separate 3 character sequence. It *may* be easier for you
    to send that than a break.

    2) I've never really used it, but from looking at it, you might be able
    to use perl and Device::SerialPort module

    3) If you were familiar with C/C++, you could look at the man page for
    tcsendbreak(3c).

    4) I'm sure if you got a copy of ckermit, that anything you can do in
    the program could be scripted.

    Good luck!

    --
    Darren Dunham com
    Unix System Administrator Taos - The SysAdmin Company
    Got some Dr Pepper? San Francisco, CA bay area
    < This line left intentionally blank to confuse you. >
    Darren Guest

  6. #6

    Default Re: How can I send a break to a remote machine?

    On Fri, 26 Sep 2003, Rich Teer wrote: 
    >
    >Either run tip from "expect", or write your own little C
    >program to send a break, and call that from your script.
    >Rich Teer, SCNA, SCSA[/ref]

    Oh don't be a tease Rich! You can post the five lines of code and then the
    guy is running with his break.c program from you. Should I post the code or
    shall you? :)

    Dennis
    Dennis Guest

  7. #7

    Default Re: How can I send a break to a remote machine?

    Approximately 9/26/03 22:42, george uttered for posterity:
     
    In EIA 232, all of the control leads use a + voltage as a binary
    one or on condition. However, all of the data leads use the - voltage
    as a binary one, or mark just to confuse you.

    A BREAK is a spacing or binary zero condition. The difference
    between a break and a Null is that the null character begins with
    the start bit [a 0 or +V] and continues to the number of bits
    in the character plus the parity bit, but then goes marking for
    the duration of the stop bit(s). A break is also a start bit
    [a 0 or +V] but it stays at binary zero long enough such that
    the start bit(s) are also zero. More formally, the difference
    between a NULL [with 8 bit even parity] is that the BREAK is
    a NULL that also has FRAMING ERROR status.



    Lon Guest

  8. #8

    Default Re: How can I send a break to a remote machine?

    On Fri, 26 Sep 2003, Dennis Clarke wrote:
     

    Gotta make people do SOME work! :-)
     

    Go for it...

    --
    Rich Teer, SCNA, SCSA

    President,
    Rite Online Inc.

    Voice: +1 (250) 979-1638
    URL: http://www.rite-online.net

    Rich Guest

  9. #9

    Default Re: How can I send a break to a remote machine?

    "george" <com> writes: 

    On the control pins, yes. The data pins use the opposite voltages
    compared to the control pins.
     

    It has nothing to do with going to 0 volts. That's a myth. RS232
    and RS423 don't detect a change in voltage if it doesn't exceed the
    threshold values (+/- 9V for RS232, +/- 3.5V for RS423). So a drop
    from -5V to 0V won't be detected as a change, since it didn't cross
    the +3.5V threshold.

    What really happens is the chips (either the cpu or UART) are not
    reset when power is shut off, so the chips glitch their outputs as
    their supply voltage dies. Possibly an unbalance in the + and -
    supply voltages as they die to 0 volts also contributes. The glitches
    go positive for long enough (3-4 milliseconds) that they look like a
    break signal to the UART chip in the Sun.

    Use a storage oscilloscope on the Sun's receive data pin, and you'll
    see what I'm talking about. If the voltage simply drops cleanly to
    0 volts, the Sun won't halt.

    -Greg
    --
    Do NOT reply via e-mail.
    Reply in the newsgroup.
    Greg Guest

  10. #10

    Default Re: How can I send a break to a remote machine?

    Approximately 9/26/03 17:52, Greg Andrews uttered for posterity:
     
    >
    > On the control pins, yes. The data pins use the opposite voltages
    > compared to the control pins.

    >
    > It has nothing to do with going to 0 volts. That's a myth. RS232
    > and RS423 don't detect a change in voltage if it doesn't exceed the
    > threshold values (+/- 9V for RS232, +/- 3.5V for RS423). So a drop
    > from -5V to 0V won't be detected as a change, since it didn't cross
    > the +3.5V threshold.[/ref]

    Extremely minor nitpick, but my copy of the EIA 232 standard
    claims that the voltage threshhold is +3 and -3, honestly can't
    recall what 423 is other than that chips for one will usually
    work for the other.

    Lon Guest

  11. #11

    Default Re: How can I send a break to a remote machine?

    On Sat, 27 Sep 2003, Rich Teer wrote: 
    >
    >Gotta make people do SOME work! :-)[/ref]

    they seem to be busy nit picking all kinds of things and not actually
    answering the bloody question.
     
    >
    >Go for it...[/ref]

    Okay .. you said so :
    ============================== ttyb_brk.c ==============================
    #include <stdio.h>
    #include <termios.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>

    int main (void)
    {
    int fd;

    if ((fd = open ("/dev/term/b", O_WRONLY)) == -1) {
    perror ("open failed");
    exit (1);
    }

    tcsendbreak (fd, 0);

    return (0);
    }
    ================================================== ==========================

    Compile it and run it. Sends a break across the ttyb port to the machine on
    the other end. Any questions? Ask Rich, he wrote it. :)


     

    yep, that's the guy there !


    Dennis
    dclarke at blastwave.org


    Dennis Guest

  12. #12

    Default Re: How can I send a break to a remote machine?

    I might br wrong , but I think in RS2322 the mark signal is +voltaage and
    the space is - voltage.
    A break is when the voltage goes to mark ( - ) for an extended period of
    time.
    This explaains why when you swith the vt100 terminal off , and the voltage
    on the tx line drops the Sparc sees it as a break signal
    George



    "Greg Andrews" <com> wrote in message
    news:bl26lk$ib8$panix.com... 
    >
    > Sorry, that's not correct. None of the RS232 signals go to ground
    > state (0 Volts) unless power has been turned off. The only valid
    > states for RS232 are +12V and -12V (and RS423 is +5V and -5V).
    >
    > A break signal is when the machine on switches its Transmit Data pin
    > from negative to positive voltage for the period of time it takes to
    > send three characters. At 9600 bps, that's about 3-4 milliseconds.
    > Break signals happen on the data pins, not the control pins like DTR.

    >
    > Shell scripts are very poor tools for controlling any interactive
    > program like ones that talk through RS232 ports.
    >
    > Use a program that has a scripting language, like Kermit. Write a
    > script in that language that sends the break at the time you want.
    > That's the right tool for the job.
    >
    > -Greg
    > --
    > Do NOT reply via e-mail.
    > Reply in the newsgroup.[/ref]


    george Guest

  13. #13

    Default Re: How can I send a break to a remote machine?



    "com" wrote:
     

    doesn't ~~# work?

    Wayne Guest

  14. #14

    Default Re: How can I send a break to a remote machine?

    Wayne Rasmussen <com> wrote:

     
     [/ref]
     [/ref]
     

    From a shell script, no.

    % ~~#
    bash: ~~#: command not found

    --
    Darren Dunham com
    Unix System Administrator Taos - The SysAdmin Company
    Got some Dr Pepper? San Francisco, CA bay area
    < This line left intentionally blank to confuse you. >
    Darren Guest

Similar Threads

  1. filecopy from remote machine to local machine
    By anu in forum PERL Modules
    Replies: 5
    Last Post: February 8th, 03:49 PM
  2. how to execute command on remote machine
    By Jianli Shen in forum PERL Modules
    Replies: 1
    Last Post: September 21st, 12:37 PM
  3. Rebooting and logging into Linux machine from a remote machine.
    By Sreenath in forum Linux Setup, Configuration & Administration
    Replies: 2
    Last Post: January 9th, 05:01 PM
  4. Setting folder permissions on remote machine / remote domain
    By Tim Chandler in forum ASP.NET Security
    Replies: 0
    Last Post: October 7th, 04:17 PM
  5. connecting to a remote unix machine
    By umit in forum UNIX Programming
    Replies: 2
    Last Post: July 29th, 08:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139