CH
Offline
God Member
Karma: 19
Posts: 703
Book Writer "Arduino Praxiseinstieg"
|
 |
« Reply #15 on: September 14, 2012, 12:52:39 pm » |
Why isn't my version working then? @stuarthooper 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 http://arduino.cc/forum/index.php/topic,121992.msg920175.html#msg9201752. 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.
|
|
|
|
|
Logged
|
|
|
|
|
CH
Offline
God Member
Karma: 19
Posts: 703
Book Writer "Arduino Praxiseinstieg"
|
 |
« Reply #16 on: September 16, 2012, 04:17:50 am » |
// 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.
|
|
|
|
|
Logged
|
|
|
|
|
CH
Offline
God Member
Karma: 19
Posts: 703
Book Writer "Arduino Praxiseinstieg"
|
 |
« Reply #17 on: September 16, 2012, 06:19:34 am » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Reading, Berkshire
Offline
Full Member
Karma: 2
Posts: 132
|
 |
« Reply #18 on: September 16, 2012, 06:23:21 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
CH
Offline
God Member
Karma: 19
Posts: 703
Book Writer "Arduino Praxiseinstieg"
|
 |
« Reply #19 on: September 16, 2012, 06:26:10 am » |
What ethernet configuration did you use in your working sketch? Copy these to your webclient sketch.
|
|
|
|
|
Logged
|
|
|
|
|
New Jersey
Offline
Edison Member
Karma: 24
Posts: 2354
|
 |
« Reply #20 on: September 16, 2012, 07:36:21 am » |
Try pinging that alleged google IP. I get no response. If I ping google.com, I get 173.194.43.6, which also brings up the google search page in a browser. Does that one work any better for you?
|
|
|
|
|
Logged
|
|
|
|
|
CH
Offline
God Member
Karma: 19
Posts: 703
Book Writer "Arduino Praxiseinstieg"
|
 |
« Reply #21 on: September 16, 2012, 10:12:33 am » |
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)?
|
|
|
|
|
Logged
|
|
|
|
|
Reading, Berkshire
Offline
Full Member
Karma: 2
Posts: 132
|
 |
« Reply #22 on: September 16, 2012, 10:22:17 am » |
Yes. The IP is correct.
|
|
|
|
|
Logged
|
|
|
|
|
CH
Offline
God Member
Karma: 19
Posts: 703
Book Writer "Arduino Praxiseinstieg"
|
 |
« Reply #23 on: September 16, 2012, 10:39:33 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #24 on: September 16, 2012, 10:45:51 am » |
byte ip[] = {78,149,131,230 }; Is this really an address on your network?
|
|
|
|
|
Logged
|
|
|
|
|
Reading, Berkshire
Offline
Full Member
Karma: 2
Posts: 132
|
 |
« Reply #25 on: September 16, 2012, 11:01:29 am » |
I get this when I go to the URL <data> <request> <type>City</type> <query>London, United Kingdom</query> </request> <time_zone> <localtime>2012-09-16 16:50</localtime> <utcOffset>1.0</utcOffset> </time_zone> </data> 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.
|
|
|
|
|
Logged
|
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #26 on: September 16, 2012, 11:07:25 am » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Reading, Berkshire
Offline
Full Member
Karma: 2
Posts: 132
|
 |
« Reply #27 on: September 16, 2012, 11:09:08 am » |
Yes it is behind a router. This IP works in my other sketch though.
|
|
|
|
|
Logged
|
|
|
|
|
Reading, Berkshire
Offline
Full Member
Karma: 2
Posts: 132
|
 |
« Reply #28 on: September 16, 2012, 11:11:13 am » |
I got that IP by googling 'what is my IP?'.
I'm guessing that makes it my IP.
|
|
|
|
|
Logged
|
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #29 on: September 16, 2012, 11:19:08 am » |
'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.
|
|
|
|
|
Logged
|
|
|
|
|
|