Boe-Bot control via internet
jotun
Posts: 1
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
' {$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
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
·
www.linuxjournal.com/article/7403
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-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
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
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
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'
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?
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
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-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