user76584: I'm trying to make a simple GET request to a server (which has a static IP but does not have a name). I'm using EtherCard library and a cheap ENC28J60 Ethernet Module. The basic configurations are OK (I can get DHCP assignment and DNS lookup), but when I try to make a simple GET request with the browseUrl method, nothing happens. I've tried to call the page from the browser and everything works fine, so it's not a server issue. The code is the following:
#include <EtherCard.h>

// ethernet interface mac address, must be unique on the LAN
byte mymac[] = { 0x54, 0x55, 0x58, 0x10, 0x00, 0x24 };

const char website[] PROGMEM = "http://10.10.10.10"; // my server
const char dnsLook[] PROGMEM = "google.com";

byte Ethernet::buffer[700];
uint32_t timer;
Stash stash;

// called when the client request is complete
static void requestCallback (byte status, word off, word len) {
  Serial.print(">>>");
  Serial.print(status);
  Serial.print("-");
  Serial.print(status);
  Serial.print("-");
  Serial.print(status);
  Serial.println("<<<");
}

void setup () {

  Serial.begin(9600);
  delay (10000);
  int res = ether.begin(sizeof Ethernet::buffer, mymac, 8);

  if (res == 0) 
    Serial.println( "Cannot access ethernet interface");

  const static uint8_t ip[] = {192,168,1,117};
  const static uint8_t gw[] = {192,168,1,1};
  const static uint8_t dns[] = {8,8,8,8};

  if (!ether.staticSetup(ip, gw, dns))
  {
      Serial.println("Cannot set static parameters");
  }

  // manually set netmask
  ether.netmask[0] = 255;
  ether.netmask[1] = 255;
  ether.netmask[2] = 255;
  ether.netmask[3] = 0;

  // dns lookup
  if (!ether.dnsLookup(dnsLook))
    Serial.println("DNS failed");
}

void loop () {
  ether.packetLoop(ether.packetReceive());
  if (millis() > timer) {
    timer = millis() + 10000;
    ether.browseUrl(PSTR("/page.php?"), "var=value", website, requestCallback);
  }
}


user76584: I made it by using EthernetENC library, as suggested by @Juraj.
To install the library, simply use the library manager and search for EthernetENC.
For those in need, below is a working code
#include <SPI.h>
#include <EthernetENC.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  // ethernet module MAC address
IPAddress server(10,10,10,10);                        // server IP address, without DNS
//char server[] = "www.site.com";                     // if your server has a DNS name, use this variable for connection

// static configuration variables
IPAddress staticIp(192, 168, 1, 217);
IPAddress staticDnsServer(8, 8, 8, 8);

EthernetClient client;                                // ethernet client object

void setup() {
  // configure CS pin
  Ethernet.init(8);

  // begin serial connection
  Serial.begin(9600);

  // wait some seconds to let the module start
  delay(5000);

  // initialize ethernet module with static configuration
  Ethernet.begin(mac, staticIp, staticDnsServer);

  // wait to let the module properly initialize
  delay(1000);

  // connection to the server
  Serial.print("Connecting to: ");
  Serial.print(server);
  Serial.println("...");

  // notify successful connection
  if (client.connect(server, 80)) {

    Serial.print("Connected to ");
    Serial.println(client.remoteIP());

    // simple GET request
    client.println("GET /page.php?var=test HTTP/1.1");
    client.println("Host: 10.10.10.10");
    client.println("User-Agent: Arduino/1.0");
    client.println("Connection: close");
    client.println();

  } else {
    // connection failed notifiation
    Serial.println("Connection failed");
  }
}

void loop() {

  // if I got a response from the server, read and print to serial
  int len = client.available();
  if (len > 0) {
    byte buffer[80];
    if (len > 80) len = 80;
    client.read(buffer, len);
    Serial.write(buffer, len);
  }

  // disconnection
  if (!client.connected()) {

    Serial.println();
    Serial.println("Disconnected");
    client.stop();

    // stop execution
    while (true) {
      delay(1);
    }
  }
}

at this link, you can see how to properly connect this module to Arduino UNO.

76584: <p>I'm trying to make a simple GET request to a server (which has a static IP but does not have a name). I'm using <a href="https://github.com/njh/ethercard" rel="nofollow noreferrer">EtherCard</a> library and a cheap <a href="https://www.amazon.it/Hiletgo-ENC28J60-Ethernet-modulo-Arduino-STM32/dp/B00WX1NRO0/" rel="nofollow noreferrer">ENC28J60 Ethernet Module</a>. The basic configurations are OK (I can get DHCP assignment and DNS lookup), but when I try to make a simple GET request with the <code>browseUrl</code> method, nothing happens. I've tried to call the page from the browser and everything works fine, so it's not a server issue. The code is the following:</p>
<pre><code>#include &lt;EtherCard.h&gt;

// ethernet interface mac address, must be unique on the LAN
byte mymac[] = { 0x54, 0x55, 0x58, 0x10, 0x00, 0x24 };

const char website[] PROGMEM = &quot;http://10.10.10.10&quot;; // my server
const char dnsLook[] PROGMEM = &quot;google.com&quot;;

byte Ethernet::buffer[700];
uint32_t timer;
Stash stash;

// called when the client request is complete
static void requestCallback (byte status, word off, word len) {
  Serial.print(&quot;&gt;&gt;&gt;&quot;);
  Serial.print(status);
  Serial.print(&quot;-&quot;);
  Serial.print(status);
  Serial.print(&quot;-&quot;);
  Serial.print(status);
  Serial.println(&quot;&lt;&lt;&lt;&quot;);
}

void setup () {

  Serial.begin(9600);
  delay (10000);
  int res = ether.begin(sizeof Ethernet::buffer, mymac, 8);

  if (res == 0) 
    Serial.println( &quot;Cannot access ethernet interface&quot;);

  const static uint8_t ip[] = {192,168,1,117};
  const static uint8_t gw[] = {192,168,1,1};
  const static uint8_t dns[] = {8,8,8,8};

  if (!ether.staticSetup(ip, gw, dns))
  {
      Serial.println(&quot;Cannot set static parameters&quot;);
  }

  // manually set netmask
  ether.netmask[0] = 255;
  ether.netmask[1] = 255;
  ether.netmask[2] = 255;
  ether.netmask[3] = 0;

  // dns lookup
  if (!ether.dnsLookup(dnsLook))
    Serial.println(&quot;DNS failed&quot;);
}

void loop () {
  ether.packetLoop(ether.packetReceive());
  if (millis() &gt; timer) {
    timer = millis() + 10000;
    ether.browseUrl(PSTR(&quot;/page.php?&quot;), &quot;var=value&quot;, website, requestCallback);
  }
}
</code></pre>
 76584: <p>I made it by using <code>EthernetENC</code> library, as suggested by @Juraj.
To install the library, simply use the library manager and search for EthernetENC.
For those in need, below is a working code</p>
<pre><code>#include &lt;SPI.h&gt;
#include &lt;EthernetENC.h&gt;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  // ethernet module MAC address
IPAddress server(10,10,10,10);                        // server IP address, without DNS
//char server[] = &quot;www.site.com&quot;;                     // if your server has a DNS name, use this variable for connection

// static configuration variables
IPAddress staticIp(192, 168, 1, 217);
IPAddress staticDnsServer(8, 8, 8, 8);

EthernetClient client;                                // ethernet client object

void setup() {
  // configure CS pin
  Ethernet.init(8);

  // begin serial connection
  Serial.begin(9600);

  // wait some seconds to let the module start
  delay(5000);

  // initialize ethernet module with static configuration
  Ethernet.begin(mac, staticIp, staticDnsServer);

  // wait to let the module properly initialize
  delay(1000);

  // connection to the server
  Serial.print(&quot;Connecting to: &quot;);
  Serial.print(server);
  Serial.println(&quot;...&quot;);

  // notify successful connection
  if (client.connect(server, 80)) {

    Serial.print(&quot;Connected to &quot;);
    Serial.println(client.remoteIP());

    // simple GET request
    client.println(&quot;GET /page.php?var=test HTTP/1.1&quot;);
    client.println(&quot;Host: 10.10.10.10&quot;);
    client.println(&quot;User-Agent: Arduino/1.0&quot;);
    client.println(&quot;Connection: close&quot;);
    client.println();

  } else {
    // connection failed notifiation
    Serial.println(&quot;Connection failed&quot;);
  }
}

void loop() {

  // if I got a response from the server, read and print to serial
  int len = client.available();
  if (len &gt; 0) {
    byte buffer[80];
    if (len &gt; 80) len = 80;
    client.read(buffer, len);
    Serial.write(buffer, len);
  }

  // disconnection
  if (!client.connected()) {

    Serial.println();
    Serial.println(&quot;Disconnected&quot;);
    client.stop();

    // stop execution
    while (true) {
      delay(1);
    }
  }
}
</code></pre>
<p>at <a href="https://create.arduino.cc/projecthub/Sourcery/how-to-connect-the-enc28j60-to-an-arduino-efd0dd" rel="nofollow noreferrer">this link</a>, you can see how to properly connect this module to Arduino UNO.</p>
