Pages: [1]   Go Down
Author Topic: nuelectronics Arduino Ethernet Shield HTTP Client  (Read 1161 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,

I'm new to Arduino, so please bare with me smiley  I recently order a nuelectronics Ethernet shield with a view to create a device that gathers data from a http server and displays it on an LCD screen.

I've been playing with the examples that are on the nuelectronics site but cant get any of the client examples working (all the others work).

On deploying the code I cant ping the shield and see no evidence of any http activity in my servers log...

What could I be doing wrong smiley-sad

Thanks

Mr_p
« Last Edit: January 10, 2009, 05:03:49 pm by Mr_p » Logged

Cheltenham, England
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino Fiend
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't think you can receive ping responses unless you program the arduino to recognise Ping requests and respond to them. You'd be better off first making sure that you can output to the LCD, and then see if you can connect to a VERY simple web server and download a text file and analyse that.
It would be a good idea to try and download a text file from a webserver first that just contains a 1 or a 0, which should turn on or off pin13 (the onboard LED) respectively.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,

Thanks for the reply - I suspected the ping might be due to it not being coded to reply to ICMP, however, I dont see any evidence of it connecting to my http server (looking in the access log nothing appears) so its as if the interface isnt being properly initalised.

Is there any way to see if this is the case?

Thanks

Mr_p
Logged

Cheltenham, England
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino Fiend
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok try adding code at various intervals throughout the client connect script that prints something to the LCD, so you can see how far the script actually is progressing..
Or print back to the USB connection as a status indicator.
Keep in mind it could be something as simple as a typo that's stopping the whole script executing..

Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

are you handling ping? do you have something like this in your sketch?

Code:
 if(buf[IP_PROTO_P]==IP_PROTO_ICMP_V && buf[ICMP_TYPE_P]==ICMP_TYPE_ECHOREQUEST_V){
    es.make_echo_reply_from_request(buf,plen);  // its a ping so do reply
    Serial.print("Got ping: ");  
  }

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok - No sign of any ICMP responses in the code - So that explains why it doesnt respond to pings!  ;D

I'll try adding some code to flash the onboard LED at vairious points, however, as per my inital post this is the HTTP client example taken from the library - I'd expect it to work as in...

For info the code is:

http://www.mr-p.org/httpclientcode.txt
Logged

Pages: [1]   Go Up
Jump to: