CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Ethernet Development Board

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ljbeng



Joined: 10 Feb 2004
Posts: 205

View user's profile Send private message

Ethernet Development Board
PostPosted: Mon Jun 07, 2010 8:52 am     Reply with quote

I have the Ethernet development board from CCS and I am just powering it up and reading the exercise book for the first time.

I want the device to act like a HTTP client. I want the dev board to send HTTP requests to my webserver on the internet. I want it to send data, like analog1, along with the HTTP request.

Ex
Code:
http://www.website.com?val1=2333;val2=444

Is this possible with the ENC28J60 and 18F4620 development board?

I want to get this data to my website for later retrieval. I could also use FTP if the Dev board can send data to my FTP server on the internet.
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Mon Jun 07, 2010 5:24 pm     Reply with quote

To send the data back would sort of be another session with a POST or possibly a GET with your return results in the URL request.

So yes. it's possible.

I'm guessing you've never written any web apps on a PC either?

You'll want a server with CGI's enabled. Consider using TCL to start since it works so nicely with strings, and that's pretty much most web pages.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Tue Jun 08, 2010 2:15 am     Reply with quote

If the PIC is the client then yes you can create a request such as you have done but your's is slightly wrong:-

Code:

http://www.website.com/page.php?val1=2333&val2=444

notice the & instead of the ; and you need the file to pass the data to (page.php)

You may have to create the request yourself unless there is a function provided for you. An http request looks like
Code:

GET /page.php?val1=2333&val2=444 HTTP/1.1[CRLF]
Host: www.website.com[CRLF]
[CRLF]


You could use cgi on the server side but it would proberbly be easier for you if you used PHP. Are you setting up your own server or using one of the many internet provided ones ?

With PHP you just access the values in the request using
Code:

$val1 = $_GET['val1'];
$val2 = $_GET['val2'];

And you just need to write this to a file.
You could provide a response back to the PIC but is not required. If you don't you may loose data!

If you wanted it to be a little more secure you could use a POST request from the PIC but that requires quite a bit more code.

Have you done much web app design ?
ljbeng



Joined: 10 Feb 2004
Posts: 205

View user's profile Send private message

PostPosted: Tue Jun 08, 2010 7:12 am     Reply with quote

I noticed later I had used ; instead of & in my example, sorry.

I do already have the website ready and waiting for data. I wrote the code using Visual Studio. This is my first website, so I can't say I have all my duck in a row....

The ethernet kit is a bit greek to me but as long as I am not starting down any blind alley, I think I can get er going.

Thanks for the replies!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group