SocketApp CLIENT sample code

Questions specifically related to the TCP/IP stack that interfaces with the driver.

Re: SocketApp CLIENT sample code

Postby navic » Thu Dec 31, 2009 10:45 am

I got this program to run and connect to my server (python code) but I can't figure out how to send data from the Arduino after the initial connection. The login string comes through just fine, but I can't seem to figure out what to include in socket_app_appcall() to send data to the server after connection. I have a simple Parallax PIR and want to send the digital read to the server. Thanks for the help!
navic
 
Posts: 1
Joined: Sat Oct 31, 2009 5:20 pm

Re: SocketApp CLIENT sample code

Postby GregEigsti » Thu Dec 31, 2009 11:04 am

First - yay python! Love python myself!
What sample code are you speaking of? The sample straight from AsyncLabs (with no mods) or some variant of the sample found elsewhere (on this thread for example)? Posting your code is always helpful ;)

This sample (direct from AsyncLabs) is built in a way that it has a small conversation with the PC and then "hangs up" the conversation. In order to get it to do what you want you will have to dissect it a bit (e.g. to keep the connection open). That said, you will be better off having the WiShield be the "server" (accepting connections) rather than the "client" (originating connections). I have found the WiShield to be rock solid as the "server" but sometimes "getting lost" when it is the client and the originator of the connection.

If you go look at this post http://asynclabs.com/forums/viewtopic.php?f=18&t=178 you will find some sample code that uses UDP and the Parallax PING))) sensor. Fair warning this project runs in "client mode" and sometimes gets lost.

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

Previous

Return to TCP/IP Stack

Who is online

Users browsing this forum: No registered users and 1 guest

cron