Port Controled WiFi RC Car.

Discussion about any of the included sketches (i.e. WebServer), or user-generated applications.

Re: Port Controled WiFi RC Car.

Postby GregEigsti » Wed Dec 30, 2009 10:38 am

techiebot,
Go take a look at the following links for examples of how to create C language TCP/UDP socket apps that run on your computer (and can communicate with the WiShield over the network). These samples go hand in hand with the WiShield equivalent sketches but both (computer code and WiShield/Arduino code) can be easily modified to do what you want. So, if you don't already have it, go download xcode from Apple so that you can start programming apps on your Mac! Yeah this is probably a big jump but help is only a post away ;)

SocketApp - example of TCP BSD socket use for your computer
http://asynclabs.com/wiki/index.php?title=SocketApp_sketch

UDPApp - example of TCP BSD socket use for your computer
http://asynclabs.com/wiki/index.php?title=UDPApp_sketch

Edit
Did not see John_Ryan's reply but it is essentially the same thing that I said ;) The benefit for you getting xcode and programming an app on the Mac side is that you will increase your knowledge on the Mac and with programming. I would stay away from Carbon/Cocoa at this point and start working on a terminal/Command line app for the time being. The reason behind this is that you don't need to learn Carbon/Cocoa to get up and running (they are the bits that give you a GUI interface) and therefore less overload. The code that you perfect in your Command line app can always be moved into a Carbon/Cocoa app. And once you are ready to move to Carbon/Cocoa I'd forget Carbon and concentrate on Cocoa as it is the newest/latest and greatest from Apple (and IMO much easier to use).

Also, I believe it was John_Ryan who said it as well - if you go for the web interface it will be platform independent and can be used from any OS with a browser. But where is the fun in that ;)

Greg
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Re: Port Controled WiFi RC Car.

Postby GregEigsti » Wed Dec 30, 2009 4:48 pm

Oh yeah you should also look at using Python on the Mac; its a great language - very "C like" but immensely more forgiving and easier to get started with. There a lot of tutorials on the web to get started; in fact most of the time that I need a quick and dirty command line app I'll just use Python because it allows me to do what I want very quickly and I don't have to constantly reinvent the wheel.

There are Python libraries that you can use for creating a GUI but I have never played with them. If I want a GUI I'll use Cocoa (on the Mac) and if I want a command line app I'll use C or Python depending upon what my needs are.

Greg
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Re: Port Controled WiFi RC Car.

Postby John_Ryan » Thu Dec 31, 2009 6:38 pm

GregEigsti wrote:Oh yeah you should also look at using Python on the Mac; its a great language - very "C like" but immensely more forgiving and easier to get started with. There a lot of tutorials on the web to get started; in fact most of the time that I need a quick and dirty command line app I'll just use Python because it allows me to do what I want very quickly and I don't have to constantly reinvent the wheel.

There are Python libraries that you can use for creating a GUI but I have never played with them. If I want a GUI I'll use Cocoa (on the Mac) and if I want a command line app I'll use C or Python depending upon what my needs are.

Greg


Command line apps / unix executables can be accessed via php using "shell exec", so it's quite easy to create the nice GUI plus db functions using a linux/php/mysql stack with ajax/xhtml/css setup on localhost.

There's quite a few interesting combinations to provide solutions for most needs. But I think for the sake of cohesion and platform independence, the effort should be put into as many remotely hosted web applications as possible. If we start creating Windows application or Unix executables then some people are going to miss out, or, effort will be duplicated making web based versions of platform dependent applications.

I haven't had time to play with my gear for quite a few months but when I get time I plan to build a user-customizable remotely-hosted web based application for sending and receiving shield data. I tested a range of flash gauges and dials and I think they would be a nice way of presenting data, I've also tested latency and on a standard 2mbps dsl connection its possible to send and receive shield data in under half a second over distances of several thousand kilometers plus the 50 meters or so between a battery powered shield and the WiFi hot spot. That kind of performance should be ok for most applications, including robot control.

I think the shield is an excellent tool, and once people have access to additional tools for using the shield then it'll let people with minimal programing knowledge unleash their imaginations. The best way, in my opinion, to provide those tools, is by way of hosted web applications. That way it's not going to matter what type of OS they are using, so long as they can run a good browser like Firefox and have a reasonably decent dsl connection.

Unfortunately I'm like most people here, have job / have wife / have son / equals minimal play time. But I'm hoping over the next few weeks with holidays I'll have a bit more time for tinkering = )
John_Ryan
 
Posts: 155
Joined: Thu Jun 04, 2009 11:24 pm

Re: Port Controled WiFi RC Car.

Postby stephanschulz » Thu Jan 07, 2010 8:55 am

hi KrashRekovery

can you post your udpapp.c (or what ever .c file you are using ?)

thanks,
stephan.
stephanschulz
 
Posts: 19
Joined: Thu Aug 06, 2009 7:00 am

Re: Port Controled WiFi RC Car.

Postby KrashRekovery » Mon Feb 01, 2010 10:10 am

OK, I have been off this project for a bit now im thrusted back into it. I have enerything working great until someone kicked the plug out of the router and I los connection to the port on the WiShield. Only problem was the car kept driving off into the wild blue yonder and didnt stop until it got run over by a REALLLLY BIG TRUCK. OUCH!!!!!!! So now I need to see if their is a way to monitor the port status. If I loose the port, I can send a stop command to control string. Any suggestions on where to look? Thanks.
KrashRekovery
 
Posts: 15
Joined: Mon Nov 23, 2009 10:42 am

Re: Port Controled WiFi RC Car.

Postby GregEigsti » Wed Feb 03, 2010 10:01 pm

Ouch! That sucks!

You can try monitoring uip_closed() in your UIP_APPCALL function to see if the connection is lost. No guarantees but it might work for you.

uIP Stack documentation
http://www.sics.se/~adam/download/uip-1.0-refman.pdf

Greg
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Re: Port Controled WiFi RC Car.

Postby rj44319 » Sat Feb 06, 2010 9:47 pm

Hey I would like to see the PC application that you are running to communicate to the shield. I am ruining MS visual C++. Also, how do you read the data coming to the shield. I only see two of the buffers being read. If you could be explanation the code a little further, that would be helpful.
rj44319
 
Posts: 25
Joined: Sat Feb 06, 2010 9:27 pm

Re: Port Controled WiFi RC Car.

Postby rj44319 » Sat Feb 13, 2010 9:37 am

Hi, I got your code and got it to work. I will upload it with the fixes when i have time.
rj44319
 
Posts: 25
Joined: Sat Feb 06, 2010 9:27 pm

Re: Port Controled WiFi RC Car.

Postby charlieo » Sat Feb 27, 2010 7:40 pm

Krashrekovery,

Do you have updated code that you could post?

Thanks,
Charlie O
charlieo
 
Posts: 15
Joined: Sun Jan 17, 2010 3:28 pm

Re: Port Controled WiFi RC Car.

Postby rj44319 » Sat Feb 27, 2010 9:18 pm

Hi, the code is done. I will upload on Monday. The code is at my work place.
rj44319
 
Posts: 25
Joined: Sat Feb 06, 2010 9:27 pm

PreviousNext

Return to Sketches and Applications

Who is online

Users browsing this forum: No registered users and 1 guest

cron