Failing to build a simple webclient

I’ve been trying for days now to do a simply web read (I only need to do a simple GET request, which returns ‘true’ or ‘false’ on the website.

The big issue: I’m using an arduino nano (which has VERY limited memory) with an ENC28J60 shield.

I’ve tried many many different scripts and none work. I was succesfull to let the nano act as a server and access it remotely, so it does work. I just can’t get it to work the other way round.

My latest attempt appears to be closest to working…except that it returns nothing. Here’s the script

#include <Nanoshield_Ethernet.h>

static byte mac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
char server[] = "";    // name address for Google (using DNS)
EthernetClient client;

void setup() {


 if (client.connect(server, 80)) {
   // Make a HTTP request:
   client.println("GET /search?q=arduino HTTP/1.1");
   client.println("Connection: close");
 else {
   Serial.println("connection failed");

void loop()
 if (client.available()) {
   char c =;

 if (!client.connected()) {

   while (true);

The resulting serial output:



any clues on how to proceed?

Are you able to access the web server using your browser ?

use EtherCard library. it has a webclient example

thank you for the replies.

yes I can access the webserver, actually the one in the sketch is google, its just to test.

And 'a few days' means that I've obviously also tested ehterCard with that one I was able to set the nano up as a server but that webclient sketch also failed. The only output to serial I got from that is: [webclient] which basically means that it didnt'even get passed the void setup()