Shop OBEX P1 Docs P2 Docs Learn Events
Boe-Bot control via internet — Parallax Forums

Boe-Bot control via internet

jotunjotun Posts: 1
edited 2007-07-20 14:33 in BASIC Stamp
I'm a high school student from Turkey, interested in robots and building a robot with a products Board of Education Rev B. and am using BASIC Stamp 2 and BASIC Stamp Editor with a desktop Windows XP computer. I have a bluetooth device(eb500) connected to Boe-Bot and I can control it with Hyperterminal. here's the code that i use to control bluetooth and robot:

' {$STAMP BS2}
' {$PBASIC 2.5}

bData VAR Byte
Freq VAR Word
COUNTER VAR Word
DISTANCE VAR Word
dist VAR Word

LOW 12
LOW 13

Main:
SERIN 0,84,[noparse][[/noparse]DEC freq]
DEBUG DEC freq
IF freq = 8 THEN FRWGO
IF freq = 2 THEN GOBACK
IF freq = 4 THEN TURNLEFT
IF freq = 6 THEN TURNRIGHT
IF freq = 7 THEN GOLEFT
IF freq = 9 THEN GORIGHT
IF freq = 1 THEN BACKLEFT
IF freq = 3 THEN BACKRIGHT

GOTO Main

FRWGO:
FOR COUNTER = 1 TO 80
PULSOUT 12, 835
PULSOUT 13, 650
PAUSE 20
NEXT
GOSUB msg
GOTO Main

GOBACK:
FOR COUNTER = 1 TO 80
PULSOUT 12, 650
PULSOUT 13, 833
PAUSE 20
NEXT
GOSUB msg
GOTO Main
' ... so it goes
GOTO Main

My problem is that I want to control robot via internet but I don't know how to add those controlling buttons to send numbers to my Hyperterminal. I've a webcam server and what I only need is to add those buttons which have snippets or, I don't know what... I'm just waiting for your comments and help.
Thanks

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2007-07-12 11:47
    Jotun,

    One possibility is to install some internet remote access software ( PC Anywhere or one of the VPN programs; even XP may have a remote access capability built-in) on your desktop computer. When you connect from a remote location, you would see the Hyperterminal screen and operate the robot over the existing Bluetooth. This method would also allow you to see the webcam image on the screen as well, I believe.

    In any case, operation over the Internet will probably introduce delays which you will have to compensate for.

    Cheers

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2007-07-12 21:36
    This article should give you some direction and ideas:

    www.linuxjournal.com/article/7403
  • Steve JoblinSteve Joblin Posts: 784
    edited 2007-07-14 00:59
    Jotun - I too have been looking for quite a while to find a simple, easy to understand tutorial on how to build the "internet side" of the solution. Like you, I have mastered sending serial commands from a terminal emulation package on my PC to a BS2 connected to a RF transmitter, which sends serial commands to a RF Receiver on my robot. I want to take it to the next level and be able to do it over the internet, but have not figured out how... I can't believe it is so difficult!!!
  • Megaman935Megaman935 Posts: 19
    edited 2007-07-16 13:50
    Steve Joblin said...

    I can't believe it is so difficult!!!
    Another thing that doesn't help steve is that he has a kid (his teamate- not his child...) that didn't even know what a transistor was 10 days ago and thinks electronics is his strong suit. That would be me. turn.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Mega
    Want to know how to build your own robot?
    www.societyofrobots.com
    Need good forums for things other than programming?
    http://www.societyofrobots.com/robotforum/index.php

    Post Edited (Megaman935) : 7/23/2007 3:30:18 PM GMT
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-07-18 02:13
    Ok - here is a possible option -·IMHO a little better than bluetooth ·- Because this is stamp related - we will have to look at the likes of a Lantronics XPORT (they also have a wireless version - best option I suppose for a robot !) - to do this seamlessly a fixed (external)·Ip address is ideal - otherwise you would have to know the current IP of the router the bot is connected to.

    I have done similar to this for remote machine control with great success..


    1) Program your Bot to respond to certain serial strings / commands.
    2) Set up XPORT as per doc - IP address and port etc and configure the serial options.
    3) Connect the Xport to your project (serial rx, tx, gnd)
    4) Configure your router to pass to the Xport IP if connection is via the configured port(on the Xport)
    ····e.g ·via NAT (Network Address Translation) - you should be able to configure a custom service on
    ····your router.·Note: You may have to adjust your firewall level also..
    5) Telnet to your external IP and configured port No.
    6) Send commands and receive replies !!

    If you were willing to go this route - I have a routine written in .Net for Socket send/receive - with a window displaying sent/received data ... but for the initial test 'telnet' will do..

    Regards,
    Quattro

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'

    Post Edited (QuattroRS4) : 7/18/2007 2:40:43 AM GMT
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-07-18 02:49
    This might be all you need
    http://com0com.sourceforge.net/

    It should allow you to use Hyperterminal on a remote machine,
    to send commands to a serial port on the local machine with stamp connected.

    regards peter

    Post Edited (Peter Verkaik) : 7/18/2007 1:37:41 PM GMT
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-07-18 08:50
    Peter,
    That's another good option .... the reason I went with the Xport method is that a P.C is not required on the remote end (where the Bot is) .... but I am not quite sure whether this is part of the requirement or not..

    Quattro

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • Steve JoblinSteve Joblin Posts: 784
    edited 2007-07-19 01:19
    Quattro / Peter:· Thanks so much for the ideas!· Initially, having a PC near the BOEbot (connected by a cheap RF transmitter on the PC and receiver on the BOEbot) is not a problem.

    given this, would you think that com0com is the easiest?· I downloaded the app, but a bit confused on how to actually use it... do you know if there is an "idiot's guide' for doing what i want to do?
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-07-19 12:49
    Regarding com0com:
    You need the package com0com-1.7.0.0-i386-chk.zip
    That unzips into 2 files: ReadMe.txt and setup.exe
    Run this setup.exe to create virtual null modem port pairs.
    (default names of first pair ports are CNCA0 and CNCB0)
    (to check on available ports, see·device manager: com0com - serial port emulators)

    Startup hyperterminal (name it ht1) and connect to CNCA0.
    startup another hyperterminal (name it ht2) and connect to CNCB0.
    Anything you now·type in ht1 is displayed in ht2 and vice versa.

    To·make this work across a·network, with ht1 running on one machine
    and ht2 running on another machine, you need package
    com2tcp-1.3.0.0-386.zip
    That unzips into two files: ReadMe.txt and com2tcp.exe
    The com2tcp.exe is a commadline utility.
    Best to place com2tcp in c:\
    Then do Start->Run: cmd
    This opens a dos box.
    Enter cd\ to move to c:\

    Now enter on system1 (with ht1 running)
    com2tcp [url=]\\.\CNCB0[/url] 1.1.1.1 10000
    (client system, host ip 1.1.1.1, host port 10000)

    For system2 (with ht2 running)
    com2tcp [url=]\\.\CNCA0[/url]·10000
    (server mode, machine system2·ip is 1.1.1.1, use port 10000)

    Now again you should be able to type anything on either hyperterminal
    and see it on the other hyperterminal.
    To make it work with real com ports, see the supplied documents
    how to rename·one of the null modem ports (eg. CNCA0) to a real·port (eg. COM2)
    so there is a virtual null modem connection between COM2 and CNCB0,
    which then in effect is a connection between hyperterminal on one system
    and the real serial port on the other system.

    regards peter
  • Steve JoblinSteve Joblin Posts: 784
    edited 2007-07-19 13:39
    Peter to the rescue!!!!!

    Thanks so much for the step-by-step instructions!

    I'll play with it over the next few days... I'm sure I may have a few follow up questions.

    Thanks again,

    Steve
  • Megaman935Megaman935 Posts: 19
    edited 2007-07-20 14:33
    I even think I understood him! shocked.gif Thanks Peter!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Mega
    Want to know how to build your own robot?
    www.societyofrobots.com
    Need good forums for things other than programming?
    http://www.societyofrobots.com/robotforum/index.php

    Post Edited (Megaman935) : 7/23/2007 3:30:32 PM GMT
Sign In or Register to comment.