Go Down

Topic: XML fetching question: Ethernet Shield (Read 7582 times) previous topic - next topic


Why isn't my version working then?

What message do you see in the serial monitor.
Compare with my working example above.
You should check the ip address from the yahoo server. May be you have to use a different. Make a ping in the command box.

Your code appears to be "different" from the code I used. I suggest you try the code that worked for me to see if you have hardware issues or just issues with your code.

I provided 2 different ways and working sketches to read the yahoo weather xml.

1. My own solution from an other thread

2. The fixed version from stuarthooper that worked on my board.

Zoomkat is right. These are two different code example. He tested successful version 1 which uses the TextFinder Library.


Code: [Select]

// Ethernet
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x13, 0x1D };
byte ip[] = { 78,149,131,230 };
byte gateway[] = { 10, 0, 1, 1 };
byte subnet[] = { 255, 255, 255, 0 };

IP doesn't match to the gateway IP.

It looks like your client can't make a connection to the Yahoo server.

Can you check your example sketch "WebClient" from the ethernet library. With this sketch you should be able to get response from the google server. After successful run of the Webclient sketch you can copy the ethernet settings to you weather sketch.


All of these services weather or time send xml data.

As I showed you in a earlier post I was able to receive the time data.

I also think the problem is in the ethernet connection and configuration. Gateway and Subnet a optional.

Did you check the WebClient example?


Yes, web client doesn't connect but my own sketch that sends and receives tweets using twitter client and the twitter library do work perfectly.


What ethernet configuration did you use in your working sketch? Copy these to your webclient sketch.


Try pinging that alleged google IP. I get no response. If I ping google.com, I get, which also brings up the google search page in a browser. Does that one work any better for you?


It looks like your client can't make a connection with the external webserver. Did you check the IP of the website (www.worldweatheronline.com)?



Code: [Select]
byte ip[] = {78,149,131,230 };

Is this really an address on your network?


I get this when I go to the URL

Code: [Select]
<query>London, United Kingdom</query>
<localtime>2012-09-16 16:50</localtime>

That is how I know to scan for <localtime>

Also my IP address is 78,147,235,111 but it doesn't work with either. Thanks for noticing that it was set wrong though. Sadly that didn't help however.


my IP address is 78,147,235,111

That address is owned by Opal Telecom DSL. Are you saying your Arduino is directly internet facing, and not behind a router?


Yes it is behind a router. This IP works in my other sketch though.


I got that IP by googling 'what is my IP?'.

I'm guessing that makes it my IP.


'What is my IP' will give you the external facing address of your router. You need to give your Arduino an address on the internal side of the router. They are usually in the 192.168 or 10.0 range. You need to find the address of your PC, to see what network address range to use.

Go Up