1

I connected corresponding pins of Arduino Nano and the Ethernet Shield, connected my computer to a router (the light indicated the connection) and Ethernet Shield to the same router. Nevertheless, there is no sign of connection on the router and the leds on the Shield don't light up either. I tried changing cables and Shields, but this didn't work. Here is my code example. What could be wrong?

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = {192, 168, 1, 3};
byte myDns[] = {192, 168, 1, 1};
byte gateway[] = {192, 168, 1, 1};
byte subnet[] = {255, 255, 255, 0};

EthernetServer server = EthernetServer(23);

void setup() {
// initialize the ethernet device
  Ethernet.begin(mac, ip, myDns, gateway, subnet);
  // start listening for clients
  server.begin();

  Serial.begin(9600);
  Serial.println(Ethernet.localIP());
  Serial.end();
}
4
  • 1
    try the examples of the Ethermet library. they have better diagnostic. what pins did you wire? – Juraj Jul 24 '20 at 14:13
  • MISO, MOSI, SCK, CS to pin D10, RST, VCC to 3.3V and GND – silencefog Jul 24 '20 at 14:16
  • 1
    the Ethernet shield is powered from 5V pin – Juraj Jul 24 '20 at 15:50
  • Thank you, I think this will help – silencefog Jul 25 '20 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.