Putting robotics at your service™

Free shipping on orders over $200

Zoomkat's router/arduino/ssc-32 wifi bot

Print view Share :
Previous topicNext topic

Page 1 of 3 [ 38 posts ]

1, 2, 3
Guru ( offline )
Posts: 2251
Posted: 2010-05-25 22:19 
A little while back I got an arduino with an ethernet shield ($63.55 delivered). I loaded the webserver application on it and made some code to parce a get request from a web brouser. I've connected my ssc-32 to the arduino serial port so the arduino can send it servo commands received from a web brouser. For testing I modified my webcam page so it sends servo commands to the arduino webserver, which modifies the command and then sends it to the ssc-32. The test flowpath is PC > wifi > netgear wireless router > cat5 > arduino > rs232 > ssc-32. Below are pix of the arduino and the ssc-32/servos. No bot part yet, but this demonstrates that a wireless router bot can be made fairly easily. There is a "black widow" version below with built in wifi. Geeks has a referbished netgear router like I'm using for $20 (supports bridging). The arduino supports servos, but I haven't tested that yet. The other part to add is a network cam to plug into the router for vision. Just wanting to see if a simple and fairly inexpensive wifi setup could be made that didn't need a pc on the bot side.

http://asynclabs.com/store?page=shop.pr ... 1&vmcchk=1





_________________
Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
http://youtube.com/watch?v=pWjMvrkUqX0
http://youtube.com/watch?v=qfyRA-g1nhI
http://web.comporium.net/~shb/S2000video.htm


User avatar
Guru ( offline )
Posts: 2956
Posted: 2010-05-26 00:02 
Very interesting! Yes, the Arduino can handle servos. I've had as many as five servos running from an Arduino without issues. This should be ideal for controlling a pan/tilt for a camera.

8-Dale

_________________
I can usually handle complexity. It's the [b][i]simple[/i][/b] things that always confound me..
Check out my [url=http://www.hybotics.me]blog[/url] now!
Open your mind, Read, Learn, Think, Apply..


User avatar
Guru ( offline )
Posts: 3578
Posted: 2010-05-26 09:14 
I get an error when I try to go to the link you provided:

Attachment:
error1.PNG
error1.PNG [ 36.54 KiB | Viewed 43604 times ]

_________________
Mike

The robotics nut.


User avatar
Guru ( offline )
Posts: 2956
Posted: 2010-05-26 11:23 
SN96 wrote:
I get an error when I try to go to the link you provided:

It worked for me. ;) Here, have a cookie. :D

8-Dale

_________________
I can usually handle complexity. It's the [b][i]simple[/i][/b] things that always confound me..
Check out my [url=http://www.hybotics.me]blog[/url] now!
Open your mind, Read, Learn, Think, Apply..


User avatar
Guru ( offline )
Posts: 4920
Posted: 2010-05-26 12:05 
It also worked for me, but they don't have any of the products in stock...

Kurt


Guru ( offline )
Posts: 2251
Posted: 2010-06-04 16:09 
Pix showing the Netgear WGR614 wireless router operating off of a 12v cordless drill battery. Router is using ~170ma from the battery. The voltage regulator on the Arduino has a max rating of 20v and 800ma per the data sheet, so it should also be able to operate off of the drill battery. Also should be able to operate the ssc-32 off of the Arduino +5v header. Getting close to hot glue time.



Edit: Routerbot taking shape. Going to be top heavy, but shouldn't be a problem just for tinkering.


_________________
Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
http://youtube.com/watch?v=pWjMvrkUqX0
http://youtube.com/watch?v=qfyRA-g1nhI
http://web.comporium.net/~shb/S2000video.htm


Guru ( offline )
Posts: 2251
Posted: 2010-10-17 19:25 
Just a quick update. I made a simple web control page for the routerbot and programmed the arduino to act as both a web server and servo controller. The continous rotation servos twitch some while being controlled by the arduino, so the ssc-32 connected to the arduino would make for better servo control. Bottom is a quick youtube capture of the servos operating in various directions and speeds being controlled via the web page > pc wifi adapter > wireless router > cat5 > arduino ethernet adapter. The video is bad, but the actual control is click quick.




_________________
Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
http://youtube.com/watch?v=pWjMvrkUqX0
http://youtube.com/watch?v=qfyRA-g1nhI
http://web.comporium.net/~shb/S2000video.htm


Guru ( offline )
Posts: 2251
Posted: 2010-10-17 21:12 
Ah! Moved the servos to pins 6 and 7 and the twitching seems to pretty much gone away. Pins 8 and above must have some additional timing activities going on. Very steady so far.

_________________
Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
http://youtube.com/watch?v=pWjMvrkUqX0
http://youtube.com/watch?v=qfyRA-g1nhI
http://web.comporium.net/~shb/S2000video.htm


Guru ( offline )
Posts: 2251
Posted: 2010-10-17 22:47 
Below is the basic code for the simple Arduino server setup and the HTML control page.

Arduino server code:
Code:
//zoomkat 10-17-10
//routerbot code
//for use with IDE 0018
//open serial monitor to see what the arduino receives
// http://arduino.cc/en/uploads/Tutorial/String.zip for WString.h

#include <WString.h>
#include <Ethernet.h>
#include <Servo.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1, 102 }; // ip in lan
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
Server server(84); //server port

String readString = String(100);
String servo1 = String(10);
String servo2 = String(10);

 
Servo myservo1;  // create servo object to control a servo
Servo myservo2;
 //////////////////////

void setup(){

//start Ethernet
Ethernet.begin(mac, ip, gateway, subnet);
server.begin();

//enable serial data print
Serial.begin(9600);
myservo1.attach(7);
myservo2.attach(6);
Serial.println("bot1"); // so I can keep track of what is loaded
}

void loop(){
// Create a client connection
Client client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
char c = client.read();

//read char by char HTTP request
if (readString.length() < 100) {

//store characters to string
readString.append(c);
}

//if HTTP request has ended
if (c == '\n') {

///////////////
Serial.println(readString);

//readString looks like "GET /?-1500-1500 HTTP/1.1"

      if (readString.length() >0) {
      Serial.println(readString);
           
      servo1 = readString.substring(7, 11);
      servo2 = readString.substring(12, 16);
     
      Serial.println(servo1);
      Serial.println(servo2);
     
      int n1;
      int n2;
     
      n1 = atoi(servo1); //convert string to number
      n2 = atoi(servo2);
      myservo1.writeMicroseconds(n1);
      myservo2.writeMicroseconds(n2);
     
      //myservo.write(n);
      readString="";
      }
  ///////////////////
 
  //now output HTML data header
  client.println("HTTP/1.1 204 Zoomkat");
  client.println();
  client.println();
  delay(1);
  //stopping client
client.stop();

/////////////////////
//clearing string for next read
readString="";
 
}}}}}



Control web page:
Code:
<HTML>
<HEAD>
<H3>Zoomkat's Routerbot<BR> Web Control Page</H3>
<TITLE>Zoomkat's Routerbot Control Page</TITLE>
</HEAD>
<BODY>

Foward-*Stop*-Reverse
<BR>

<a href="http://192.168.1.102:84/?-1000-2000" target="inlineframe">F-F</a>|
<a href="http://192.168.1.102:84/?-1450-1550" target="inlineframe">S-F</a>|
<a href="http://192.168.1.102:84/?-1500-1500" target="inlineframe">*-Stop-*</a>|
<a href="http://192.168.1.102:84/?-1550-1450" target="inlineframe">S-R</a>|
<a href="http://192.168.1.102:84/?-2000-1000" target="inlineframe">F-R</a>|
<BR>
<BR>
Turn-L-*Stop*-Turn-R
<BR>
<a href="http://192.168.1.102:84/?-1000-1000" target="inlineframe">F-L</a>|
<a href="http://192.168.1.102:84/?-1450-1450" target="inlineframe">S-L</a>|
<a href="http://192.168.1.102:84/?-1500-1500" target="inlineframe">*-Stop-*</a>|
<a href="http://192.168.1.102:84/?-1550-1550" target="inlineframe">S-R</a>|
<a href="http://192.168.1.102:84/?-2000-2000" target="inlineframe">F-R</a>|
<BR>
<IFRAME name=inlineframe
src="res://D:\WINDOWS\System32\shdoclc.dll/dnserror.htm" width=1
height=1> this will hold the html answer of the moves
</IFRAME>

</body>
</html>

_________________
Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
http://youtube.com/watch?v=pWjMvrkUqX0
http://youtube.com/watch?v=qfyRA-g1nhI
http://web.comporium.net/~shb/S2000video.htm


User avatar
Guru ( offline )
Posts: 4126
Posted: 2010-10-18 14:54 
OK, this is interesting!

Could you explain what you're doing for the uninformed? ;>)

I take it you are using the Arduino Ethernet shield, which is wired into the wireless router (serial?).

You run the HTML code on the router (?).

The C code in the Arduino accesses the router (?).

A PC browser opens the router page at 192, 168, 1, 102 (or one of those numbers in the program.

The parameters are then accessible on the PC.

Can you elaborate?

Can something similar be done with the Lantronix?

(And I realize we will be getting a PC program to work as a control program from LM).

Looking to learn a little bit more...

Thanks!

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Guru ( offline )
Posts: 2251
Posted: 2010-10-18 18:38 
"Could you explain what you're doing for the uninformed? ;>) "

Generally make a wireless "routerbot" as cheaply and simply as possible. Some powerful routers like the Buffalo ones in bridging mode might get 2,500' line of sight range. Google for wifi shootout to see what large antennas can do. Also IP cams can be plugged directly into routers to give the bot some vision capability.

"I take it you are using the Arduino Ethernet shield, which is wired into the wireless router (serial?)."

The connection between the ethernet shield and the router is an ethernet connection (which can be a piece of cat3 four conductor phone wire with RJ45 connectors on each end). The ethernet shield functions similar to a network card in a pc. No RS232 type serial communication involved.

"You run the HTML code on the router (?)."

No, the router is stock with no mods. The HTML is just copy/paste in notepad on the desktop. If desired the arduino can serve up such simple web pages.

"The C code in the Arduino accesses the router (?)."

The arduino/ethernet shield communicates with the router just like a pc with a network card. The router sees the arduino as another connected pc or similar. The arduino handles the network traffic as well as the I/O with external devices

"A PC browser opens the router page at 192, 168, 1, 102 (or one of those numbers in the program."

Yes, this is the IP address assigned to the arduino/ethernet shield. I used this as when the router is disconnected from the internet, as DNS lookups are not possible when disconnected. If the router was bridged to another router connected to the internet, then typical URLs like zoomkat.no-ip.com can be used in the web page. Port fowarding can be used on the net connected router so a connection to the arduino can be made from most anywhere, even a web connected Iphone on the other side of the world.

"The parameters are then accessible on the PC."
"Can you elaborate?"

This particular web page is set up for only sending commands and receiving webcam feeds if desired. If one wants to also obtain data from the arduino and display it on the web page, then the page would be made with two frames to handle the two types of traffic. Not difficult, just use notepad and a little html knowledge.

"Can something similar be done with the Lantronix?"

I'm not familiar with the lantronix protocols, but I would think it would be more involved and difficult to make into a user GUI, particularly a web based one.

"(And I realize we will be getting a PC program to work as a control program from LM)."

I made some comments on the project when it was announced, but they immediately disappeared. As with other projects, I guess I'll sit back and see how it goes.

"Looking to learn a little bit more..."

Lots of neat stuff out there.

_________________
Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
http://youtube.com/watch?v=pWjMvrkUqX0
http://youtube.com/watch?v=qfyRA-g1nhI
http://web.comporium.net/~shb/S2000video.htm


User avatar
Guru ( offline )
Posts: 4126
Posted: 2010-10-18 19:10 
Thanks Z,

zoomkat wrote:
Generally make a wireless "routerbot" as cheaply and simply as possible. Some powerful routers like the Buffalo ones in bridging mode might get 2,500' line of sight range. Google for wifi shootout to see what large antennas can do. Also IP cams can be plugged directly into routers to give the bot some vision capability.


The use of a wireless router is interesting, but a little bulky. I'm hoping to come up to speed with what I think can be done with the Lantronix. But I do have a spare WLAN router...

zoomkat wrote:
The connection between the ethernet shield and the router is an ethernet connection (which can be a piece of cat3 four conductor phone wire with RJ45 connectors on each end). The ethernet shield functions similar to a network card in a pc. No RS232 type serial communication involved.


Ah yes, the "shield" is an add-on "expansion" card to the Arduino. So it's just like an ethernet card for a PC. I suppose it could be added to a BBII as well? I think the Lantronix can do that as well (guess I'll find out).

The Arduino Ethernet board

http://arduino.cc/en/Guide/ArduinoEthernetShield

Is sounding a lot like what I suspect the Lantronix can do. In the Blackfin Camera, the Blackfin talks to the Lantronix, but doesn't need to use a LAN connection, just one of the high speed serial ports of the WLAN. Does that mean the Blackfin processor is implementing the TCP/IP stack for conversing with the WLAN? (I'm starting to confuse myself, so I'd better stop).

But as you mentioned, you're not up on the Lantronix or Blackfin; no worries!

zoomkat wrote:
No, the router is stock with no mods. The HTML is just copy/paste in notepad on the desktop. If desired the arduino can serve up such simple web pages.


I know the Lantronix can support a LAN connection (with the appropriate magnetics), so it could talk to an internet card, and work like your card.

zoomkat wrote:
The arduino/ethernet shield communicates with the router just like a pc with a network card. The router sees the arduino as another connected pc or similar. The arduino handles the network traffic as well as the I/O with external devices


"The arduino Ethernet shield handles the network traffic..."
Yeah, that answers my question!

zoomkat wrote:
Yes, this is the IP address assigned to the arduino/ethernet shield. I used this as when the router is disconnected from the internet, as DNS lookups are not possible when disconnected. If the router was bridged to another router connected to the internet, then typical URLs like zoomkat.no-ip.com can be used in the web page. Port fowarding can be used on the net connected router so a connection to the arduino can be made from most anywhere, even a web connected Iphone on the other side of the world.


I copied your HTML code to a file, then opened it up with my PC browser. It looks like you've shown with one of your pix. Of course, I don't have a 192, 168, 1, 102 connection (but I think I know what the Lantronix one I set up is), so I didn't get anything, but I think I'm catching on slowly...

A few more hints and experiments should help.

zoomkat wrote:
This particular web page is set up for only sending commands and receiving webcam feeds if desired. If one wants to also obtain data from the arduino and display it on the web page, then the page would be made with two frames to handle the two types of traffic. Not difficult, just use notepad and a little html knowledge.

My Lantronix is connected to the Blackfin camera, which has a video feed, and a control protocol. So I'm seeing the similarities.

Lots of neat stuff out there.


I have a little HTML knowledge, looking for more! Yeah, a LOT of stuff out there!

Thanks for the tutorial (I'm looking for more on the web)!

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


User avatar
Veteran ( offline )
Posts: 235
Posted: 2010-10-18 21:53 
Zoomkat, you would probably save yourself a ton of hassle to just use a Wifi UART adapter.
http://forums.basicmicro.net/atom-f484/wifi-t9461.html

Furthermore, i want you to check this out.
http://hackaday.com/2009/09/25/with-zip ... a-netbook/
and


I want to try using this eventually, but i need to save up first.
Also the zipit, has an internal serial port, you'll need to do a little soldering, but it's just 4 easy to access points.
Zipits Z2's are less than $40 USD.

I'll admit zoomkat, you got me beat when it comes to budget robotics. Those look like peanut butter jar lids as wheels. Which if reinforced actually sounds like a great idea come to think of it.
You can probably open up the router to decrease it's weight and size, as well as allow you to move the antenna, which if i'm not mistaken is attached via a ULF connector.
Edit: Lay the router horizontally and then place the battery ontop of it? It'll help center the gravity on it, and make it less top heavy. At least it looks like it'll do that.

_________________
Say no to real Trees this Christmas.
Real trees are very flammable, and can be a host to diseased insects.
http://blog.basicmicro.comB
asic Micro Blog: Kenjj and Fallentine
Got sick, now I'm back.


Guru ( offline )
Posts: 2251
Posted: 2010-10-18 23:09 
I looked at the zipits a couple of years back (below), but they looked like they would take a good bit of tinkering to get going. Maybe since then more hacking info is available. One can get an arduino 328 and W5100 ethernet shield on ebay for ~$60 including postage. Lot of technical info and activity on the arduino forum beyond bots (auto flushing toilets, etc.).

viewtopic.php?f=30&t=2655

_________________
Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
http://youtube.com/watch?v=pWjMvrkUqX0
http://youtube.com/watch?v=qfyRA-g1nhI
http://web.comporium.net/~shb/S2000video.htm


User avatar
Veteran ( offline )
Posts: 235
Posted: 2010-10-18 23:28 
A lot more is capable with it.
It supports debian linux without to much effort. It can be hacked in less than 5 minutes.
And linux supports plenty of programs, you just need to remember a few dozen commands.
Terminal applications are readily available.
People have even programmed an arduino using it.

And it would be easy enough to write your own programs, even internally.

Look into the Zipit Z2, i plan on getting on eventually.

_________________
Say no to real Trees this Christmas.
Real trees are very flammable, and can be a host to diseased insects.
http://blog.basicmicro.comB
asic Micro Blog: Kenjj and Fallentine
Got sick, now I'm back.


1, 2, 3

All times are UTC - 5 hours [ DST ]. It is currently 2014-11-23 14:29
Feedback Form
Feedback Form