Shop OBEX P1 Docs P2 Docs Learn Events
Trouble communicating between BS2 and PINK — Parallax Forums

Trouble communicating between BS2 and PINK

Lobo05Lobo05 Posts: 12
edited 2006-03-15 13:21 in BASIC Stamp
Hi everyone,

We are building a 3 sensors system that will monitor the temp and humidity, post to the 4x20 LCD and also to·a dynamic webpage on the PINK. We got the sensiron sensors to work with the LCD and the debug terminal but can't get the data posted onto a website. We are using a BOE with a BS2, a serial LCD, and a PINK. We are having trouble with communicating between the PINK and the BS2.

We want to write to the web variables using the Basic Stamp Editor.·We have set the baud rate to 2400, 8 data bits, no data parity and 1 stop bit. The code that·we're using to write to variable 0 is SEROUT 15,396,[noparse][[/noparse]"!NB0W00:25",CLS]. We have also tried to telnet to the module. The screen does not display anything.·We are at a complete loss right now.

Also, is it better to use the variable (1:19) or the variable (20:~).· We have tried both and had no success in sending values to the PINK.·

Attached is a copy of our code.

Thanks for the help!
640 x 480 - 62K

Comments

  • steve_bsteve_b Posts: 1,563
    edited 2006-03-14 13:13
    You've set your BS2 to talk @ 2400 baud (True396). Have you set your PINK to do the same? I believe the default is 9600 baud (84), but I'm not positive!

    I can't quite tell from your image what pins you have connect to the PINK, but be sure to follow the docs you got with it. Grounds are important.

    Were you able to give the PINK an IP address and all that network setup mojo?
    You should be able to use the cross-over cable they give you and connect your computer directly to the pink.
    I've only briefly played with my PINK and am now packing for a move, so all my stamp stuff is in boxes now! Someone else will have to chime in!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • stamptrolstamptrol Posts: 1,731
    edited 2006-03-14 13:28
    Do you have the PINK able to display the webpage (either the default or your temp/humidity page)?

    Once you're at that point, the docs that came with the PINK will let you put those registers into the page. Also, as Steve pointed out, the Stamp and the PINK have to be set to the same baud rate aand parameters.

    This will work!
  • Lobo05Lobo05 Posts: 12
    edited 2006-03-15 03:15
    Thanks for the posts, this is an incredible way to solve problems (kudos to parallax)!

    Anyway, I will check the baud rate connections on the PINK, I wasn't aware from the documentation that you can set the Baud rate on the pink, but rather that it was a negotiated rate between the BS2 and the PINK. (Where do I set that...in case I can't find it before someone replies!)

    We do have it displaying a webpage, and it does post the values in the registers...although we haven't been able to have the BS2 send these values to the PINK. So as of yet it is posting..

    The temperature is NA ......... where NA is associated to :

    The temp is <Nb_var20>

    The down side to the documentation is that it gives an example as to how to input a value to the variables like 25, but it doesn't give examples of how to dynamically update these variables via the basic stamp.

    We are getting alot out of this experience with the PINK and the BS2.

    Thanks again!
  • Tony BTony B Posts: 7
    edited 2006-03-15 05:03
    I don't know if this is what you were looking for, but below is a snippet of code I am utilizing with the PINK module. The first SEROUT command is sending a value to the PINK var 02.

    WES VAR BYTE(40)
    B2 VAR BYTE

    SEROUT 6, I9600 , [noparse][[/noparse] 0 ,"!NB0W02:" , DEC B2 , 0 ] ' send the dynamic value of B2 to the PINK variable 02
    SEROUT 6, i9600 ,[noparse][[/noparse] 0 , "!NB0R02" ] ' poll the PINK variable 02
    SERIN 5 , I9600 ,[noparse][[/noparse]STR WES\40\0] ' store the value of PINK var 02 to ATOM var

    The above code was utilized on a Basic Micro Atom chip, however is should convert over to the STAMP applicaiton without much modification.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Every problem has a solution. Some don't even create more problems.
  • steve_bsteve_b Posts: 1,563
    edited 2006-03-15 13:21
    RE: setting the baud rate,
    you should be able to 'log in' to the stamp through its factory_setup page (can't remember how its worded).
    This will get you in to where you can set the IPs and other things directly on the PINK.

    Just look at the documentation that Parallax gives with the PINK
    http://www.parallax.com/dl/docs/prod/comm/30013-PINK-v1.02.pdf
    That's right off their webpage.· It shows them using the IP-tools, and you can see the baud rate value on teh same page the IP addy's are.
    Or you can go to the http://<IP address of PINK>/nb_factory.htm and change the settings there (if you've set a password you'll need to enter it I believe).


    Get them talking first....then you may find your data showing up on your webpage!
    You should post your HTML code as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
Sign In or Register to comment.