Shop OBEX P1 Docs P2 Docs Learn Events
internet controlled basic stamp? — Parallax Forums

internet controlled basic stamp?

ArchiverArchiver Posts: 46,084
edited 2004-03-26 14:56 in General Discussion
Hi everyone,

I am looking for a way to create an interface for users to
control the functions of my stamp(2) over the internet. Basically,
I want to set up a web page with a few buttons. When pressed, the
signal from the internet will tell a stamp pin to go high. I've
seen things called Phidgets, they are a little pricey, and you have
to code them in Visual Basic. Maybe something easier to control? I
appriciate any help you may offer.

Thanks

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-03-24 01:02
    I think the best approach is to create some sort of serial protocol for
    the stamp and hook it up to a device that can run a webserver, like a
    linux system. There was somebody who wrote a pic-based tcp/ip stack, but
    he kind of cheated by using SL/IP.

    On Tue, 23 Mar 2004, mwweisert wrote:

    > Hi everyone,
    >
    > I am looking for a way to create an interface for users to
    > control the functions of my stamp(2) over the internet. Basically,
    > I want to set up a web page with a few buttons. When pressed, the
    > signal from the internet will tell a stamp pin to go high. I've
    > seen things called Phidgets, they are a little pricey, and you have
    > to code them in Visual Basic. Maybe something easier to control? I
    > appriciate any help you may offer.
    >
    > Thanks
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.
    >
    > Yahoo! Groups Links
    >
    >
    >
    >
    >
    >

    Sean T. Lamont, CTO / Chief NetNerd, Abstract Software, Inc. (ServNet)
    Seattle - Bellingham - Vancouver - Portland - Everett - Tacoma - Bremerton
    email: lamont@a... WWW: http://www.serv.net
    "Do not fear mistakes, There Are None" - Miles Davis
  • ArchiverArchiver Posts: 46,084
    edited 2004-03-24 13:27
    LabView has this capability, but is on the pricy side. I'm not sure if the
    demo version does enough to help you.

    LabView can then talk to your Stamp via the serial port and has what you are
    looking to do.

    Michael Williams
    Tyco Electronics, Hardware Engineering Group
    221 Jefferson Ridge Parkway
    Lynchburg, Virginia 24501

    williammi@t... <mailto:williammi@t...>

    I have taken a vow of poverty... to annoy me, please PayPal money to
    "michael@f..."


    Original Message
    From: mwweisert [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Bb8D7xgoqPuJNHt7uCAi3kxY75ZHAZE4lQBI9B2VwY5Ui9Qv28CRc18tCbLjn2cN7CnYt3OTi80kDI0w]mwweisert@y...[/url
    Subject: [noparse][[/noparse]basicstamps] internet controlled basic stamp?

    Hi everyone,

    I am looking for a way to create an interface for users to
    control the functions of my stamp(2) over the internet. Basically,
    I want to set up a web page with a few buttons. When pressed, the
    signal from the internet will tell a stamp pin to go high.
  • ArchiverArchiver Posts: 46,084
    edited 2004-03-24 13:39
    Well, for that matter if you don't mind a PC gateway, have a look at
    http://www.awce.com/netporter.htm

    Regards,

    Al Williams
    AWC
    * New: Simplified floating point math
    http://www.awce.com/pak12.htm




    Original Message
    From: Williams, Michael [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=h3VUGtgneGuI8OTgVYgEGqj4HACHdLHP_R17YAL2Ljg2bZnf5JMIa0J98en8weJWANZ2dK-3us17CVGDTYQh4BXtIw]williammi@t...[/url
    Sent: Wednesday, March 24, 2004 7:28 AM
    To: 'basicstamps@yahoogroups.com'
    Subject: RE: [noparse][[/noparse]basicstamps] internet controlled basic stamp?



    LabView has this capability, but is on the pricy side. I'm not sure if the
    demo version does enough to help you.

    LabView can then talk to your Stamp via the serial port and has what you are
    looking to do.

    Michael Williams
    Tyco Electronics, Hardware Engineering Group
    221 Jefferson Ridge Parkway
    Lynchburg, Virginia 24501

    williammi@t... <mailto:williammi@t...>

    I have taken a vow of poverty... to annoy me, please PayPal money to
    "michael@f..."


    Original Message
    From: mwweisert [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=GvAaBbjZRSZBsmVLd8HHL813nLFRoNESTmPPj5R__Qv9w9OG2KNDz8O62AkF5yJcsQIhX8yDuG_6nGmA]mwweisert@y...[/url
    Subject: [noparse][[/noparse]basicstamps] internet controlled basic stamp?

    Hi everyone,

    I am looking for a way to create an interface for users to
    control the functions of my stamp(2) over the internet. Basically,
    I want to set up a web page with a few buttons. When pressed, the
    signal from the internet will tell a stamp pin to go high.


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.

    Yahoo! Groups Links
  • ArchiverArchiver Posts: 46,084
    edited 2004-03-25 06:32
    --- In basicstamps@yahoogroups.com, "mwweisert" <mwweisert@y...>
    wrote:
    > I am looking for a way to create an interface for users to
    > control the functions of my stamp(2) over the internet. Basically,
    > I want to set up a web page with a few buttons. When pressed, the
    > signal from the internet will tell a stamp pin to go high.

    I experimented with an Ethernet interface for a microcontroller (a BX-
    24) recently using the RealTek RTL8019. I put together a web page
    showing what I did, including schematics, at
    http://www.kinzers.com/don/BX24/Ethernet

    You could do something similar but the limited RAM space of the Basic
    Stamp is going to problematic. A UDP packet with a single byte of
    payload requires 43 bytes. (You could add external RAM like I did on
    my Basic Stamp diesel generator controller, I suppose. See
    http://www.kinzers.com/don/GenSet for schematics and code.)
  • ArchiverArchiver Posts: 46,084
    edited 2004-03-25 18:40
    hello,

    save your money. you can use PERL/CGI

    this is an example program to show how easy it is to talk to the
    basic stamp through the serial port using perl. for simplicity, i
    haven't put validity checks in the program that follows.

    to be able to use the com ports in perl, you need:

    activeperl for windows (free download here):

    http://www.activestate.com/Products/Language_Distributions/

    then after you have installed it in windows, go to the command line
    and type (you will need to be connected to the internet)

    ppm
    install win32-API

    then download this:

    http://members.aol.com/Bbirthisel/SerialPort-0_19.zip

    unzip the file, then type:

    perl Makefile.PL
    perl test.pl
    perl install.pl

    now you should be able to run the following file by typing:

    perl control.pl


    #**************************************************************
    # file name: control.pl

    #**************************************************************
    # rcobo@e...
    # 3/25/2004
    #
    # you are free to copy/modify/distribute this program.
    #
    # this program talks to the Basic Stamp controller through COM1.
    # it sends a character to the BasicStamp and receives a message.
    # then the program writes the message to a file named data.txt.
    # data.txt will be at the same directory where this program is.
    #
    # this program has been tested in windows XP and requires:
    # Perl interpreter for windows (free): ActivePerl 5.8.2.808
    # Perl Module (free): win32-API
    # Perl Module (free): SerialPort-0_19
    #****************************************************************

    use Win32::SerialPort;

    #**************** COM1 ******************************************

    my $port = 'COM1';
    my $PortObj = new Win32::SerialPort ($port) || die "Can't open $port:
    $^E\n";

    #**************** COM1 SETTINGS *********************************

    $PortObj->baudrate(9600);
    $PortObj->databits(8);
    $PortObj->parity("none");
    $PortObj->stopbits(1);
    $PortObj->write_settings || die "couldn't write settings\n";

    #******** SEND CHARACTER THROUGH COM1 ****************************

    $PortObj->write("A");

    #******** WAIT **************************************************

    sleep 1; #if you want to wait n seconds

    #******* RECEIVE A MESSAGE *************************************

    my $buffersize = 10;
    my ($bitesreceived, $message) = $PortObj->read($buffersize);
    print( "read $bitesreceived bites\n") unless ($bitesreceived ==
    $buffersize);

    #******* WRITE FILE *****************************************

    open( OUTFILE, ">data.txt") or die( "can't find file data.txt\n" );

    print( OUTFILE "$message\n" );

    #******* CLOSE COM1 ********************************************

    undef $PortObj;

    #****** END OF PROGRAM ****************************************
  • ArchiverArchiver Posts: 46,084
    edited 2004-03-26 14:56
    WOW, that is SO excellent!
    I browsed the .PM code, and I had no idea the
    Win32::CommPort API was so clunky. This puts
    a nice wrapper around it. Thanks!!

    --- In basicstamps@yahoogroups.com, "zauborg" <zauborg@y...> wrote:
    > hello,
    >
    > save your money. you can use PERL/CGI
    >
    > this is an example program to show how easy it is to talk to the
    > basic stamp through the serial port using perl. for simplicity, i
    > haven't put validity checks in the program that follows.
    >
    > to be able to use the com ports in perl, you need:
    >
    > activeperl for windows (free download here):
    >
    > http://www.activestate.com/Products/Language_Distributions/
    >
    > then after you have installed it in windows, go to the command line
    > and type (you will need to be connected to the internet)
    >
    > ppm
    > install win32-API
    >
    > then download this:
    >
    > http://members.aol.com/Bbirthisel/SerialPort-0_19.zip
    >
    > unzip the file, then type:
    >
    > perl Makefile.PL
    > perl test.pl
    > perl install.pl
    >
    > now you should be able to run the following file by typing:
    >
    > perl control.pl
    >
    >
    > #**************************************************************
    > # file name: control.pl
    >
    > #**************************************************************
    > # rcobo@e...
    > # 3/25/2004
    > #
    > # you are free to copy/modify/distribute this program.
    > #
    > # this program talks to the Basic Stamp controller through COM1.
    > # it sends a character to the BasicStamp and receives a message.
    > # then the program writes the message to a file named data.txt.
    > # data.txt will be at the same directory where this program is.
    > #
    > # this program has been tested in windows XP and requires:
    > # Perl interpreter for windows (free): ActivePerl 5.8.2.808
    > # Perl Module (free): win32-API
    > # Perl Module (free): SerialPort-0_19
    > #****************************************************************
    >
    > use Win32::SerialPort;
    >
    > #**************** COM1 ******************************************
    >
    > my $port = 'COM1';
    > my $PortObj = new Win32::SerialPort ($port) || die "Can't open
    $port:
    > $^E\n";
    >
    > #**************** COM1 SETTINGS *********************************
    >
    > $PortObj->baudrate(9600);
    > $PortObj->databits(8);
    > $PortObj->parity("none");
    > $PortObj->stopbits(1);
    > $PortObj->write_settings || die "couldn't write
    settings\n";
    >
    > #******** SEND CHARACTER THROUGH COM1 ****************************
    >
    > $PortObj->write("A");
    >
    > #******** WAIT **************************************************
    >
    > sleep 1; #if you want to wait n seconds
    >
    > #******* RECEIVE A MESSAGE *************************************
    >
    > my $buffersize = 10;
    > my ($bitesreceived, $message) = $PortObj->read($buffersize);
    > print( "read $bitesreceived bites\n") unless ($bitesreceived ==
    > $buffersize);
    >
    > #******* WRITE FILE *****************************************
    >
    > open( OUTFILE, ">data.txt") or die( "can't find file data.txt\n" );
    >
    > print( OUTFILE "$message\n" );
    >
    > #******* CLOSE COM1 ********************************************
    >
    > undef $PortObj;
    >
    > #****** END OF PROGRAM ****************************************
Sign In or Register to comment.