Hello - I was wondering if I could get some help with my Yun regarding the WebClient code example. My Yun is connected by Ethernet and I can see it on the router and access it using a browser.
When running the WebClient example, I get the "Failed to configure Ethernet using DHCP" message, then "connecting..." forever. As far as I can tell it is not getting out of setup().
That code will not work on the Yun, it is intended for a more traditional Arduino with an Ethernet shield. The Yun uses a completely different philosophy for networking. Basically, if the sketch you are looking at includes Ethernet.h or WiFi.h, it simply will not work with the Yun.
The equivalent example sketch you want to be looking at is HttpClient example. compare the code, see how much simpler it is? The code you are trying manages all of the networking using the sketch and the limited resources of the AVR processor. The Yun version does all of the networking management using the Linux processor - this makes the networking much more powerful, and greatly simplifies the sketch, leaving more of the limited AVR resources for use by a more complicated sketch.
Thank you for the help, I appreciate it. I tried running the HTTPClient code that comes as an example in the Arduino 1.6.6 IDE. As opposed to getting the Arduino logo, I originally got:
What seems to have happened is that the poster in this other thread noted a problem. The solution got propagated into the example in the IDE but did not get propagated to the link at https://www.arduino.cc/en/Tutorial/HttpClient
Then the original server issue was resolved and now the "old" web code works and the "new" IDE code is broken.
I mention all of this to show my appreciation for the help and also to assist the moderators/developers in reverting the change in the IDE for the next IDE release.
Sometimes I am not very clear so if I haven't been clear here, let me know and I will elaborate if I can be of help.