TransWikia.com

Ethernet Shield doesn't work at all

Arduino Asked by silencefog on December 30, 2021

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();
}

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP