Shop OBEX P1 Docs P2 Docs Learn Events
PINK: Correct Telnet output and correct CLS — Parallax Forums

PINK: Correct Telnet output and correct CLS

Jared FryJared Fry Posts: 4
edited 2006-02-02 19:03 in BASIC Stamp
I am communicating with a pink ethernet module using a microprocessor (not a stamp though) and am not able to correctly command the PINK. I can see my messgaes come through on the telnet, but am not sure if what I am seeing is actually correct. Could someone provide me with a telnet output that is correct or that corresponds to a sucessful command? Thanks.

This is what I am seeing on Telnet:

Diagnostic display of Stamp to Netburner I/O
type logout to exit the monitoring session
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]<CLS>]
Received from stamp:[noparse][[/noparse]!NBO]
Received from stamp:[noparse][[/noparse]W]
Received from stamp:[noparse][[/noparse]0]
Received from stamp:
Received from stamp:[noparse][[/noparse]:]
Received from stamp:
Received from stamp:

... and then it stops there.

Note, I am writing in C. I am assuming that outputing a CLS at the end of the command/message in BASIC is equivalent to a printf("\0") in C. I have not seen anything that confirms this for me though. I am operating at 9600 baud as well.

Thanks,

Jared

Comments

  • Jared FryJared Fry Posts: 4
    edited 2006-02-02 16:35
    It looks like i lost some of the data in the previous posting when it was posted, the following lists in order WHAT IS INSIDE THE BRACKETS on my telnet window

    <CLS>
    <CLS>
    <CLS>
    !NBO
    W
    0
    4
    :
    3
    4
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-02-02 17:52
    CLS is a binary 0, as you stated.
    It looks like you use !NBOW04:34
    however, you should use !NB0W04:23
    (use a 0 (zero) after !NB, not a O (capital o))

    regards peter
  • Jared FryJared Fry Posts: 4
    edited 2006-02-02 18:21
    Thanks Peter, that seemed to get me past the 1st hurdle. No my telnet output looks like this:

    Received from stamp:[noparse][[/noparse]<CLS>]
    Received from stamp:[noparse][[/noparse]<CLS>]
    Received from stamp:[noparse][[/noparse]!NB0W02:23


    but I never get the ending bracket nor any other line to follow (nor a <CLS>). This makes me think that I am not terminating the message/command correctly with teh CLS. If I try and send a UDP message, I get this:

    Received from stamp:[noparse][[/noparse]<CLS>]
    Received from stamp:[noparse][[/noparse]<CLS>]
    Received from stamp:[noparse][[/noparse]<CLS>]
    Received from stamp:[noparse][[/noparse]!NB0WBI:192.168.0.101!NB0WBM:Hello Jareds Laptop!NB0SM

    Note, some of the variables I noticed have changed when looking at the PINK variables via my browser. For example, variable 2 has in it [noparse][[/noparse]23#???]. My guess is that the #??? is just garbage that got picked up, possibly because of improper termination.

    Again, my C code looks like this:

    printf("!NB0W02:23\0");



    Thanks

    Jared
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-02-02 18:50
    The problem with printf() is that it does print the \0.

    Try printf("!NB0WBI:192.168.0.101%c",(char)0);

    this will print the binary 0 after the string.

    regards peter
  • Jared FryJared Fry Posts: 4
    edited 2006-02-02 19:03
    That did it, thanks Peter for your help. I am successfully send UDPs, writing to variables, and emailing.

    Jared
Sign In or Register to comment.