Arduino Forum

Using Arduino => Networking, Protocols, and Devices => Topic started by: heini on Nov 19, 2015, 12:46 pm

Title: Establishing connection (using UIPEthernet library)
Post by: heini on Nov 19, 2015, 12:46 pm
I just started Arduino and wanted to test my first Ethernet project. Sadly I dont even get a simple connection to run :(

Im using a Arduino Uni with a ENC28J60 Network Module and the UIPEthernet library. Im pretty confident that the pins are connected correctly (SC to Pin10)

The red LED on D1 is turning on -there is no green LED :(

This is the code im currently using:

Code: [Select]

#include <UIPEthernet.h> // Used for Ethernet

byte mac[] = { 0x54, 0x34, 0x41, 0x30, 0x30, 0x31 };                                     
IPAddress ip(192, 168, 1, 179);                       
EthernetServer server(80);

void setup() {
  Serial.begin(9600);
  Ethernet.begin(mac, ip);
  server.begin();
  debug();
}

void loop() {
  EthernetClient client = server.available();
 
  if (client)
  { 
    Serial.println("-> New Connection");

  }
}

void debug()
{
    Serial.print("IP Address        : ");
    Serial.println(Ethernet.localIP());

    Serial.print("Subnet Mask       : ");
    Serial.println(Ethernet.subnetMask());

    Serial.print("Default Gateway IP: ");
    Serial.println(Ethernet.gatewayIP());

    Serial.print("DNS Server IP     : ");
    Serial.println(Ethernet.dnsServerIP());
}



If I try to connect to the IP, it just hangs ;(



If anyone can help me with this problem, I would really applicate it.

Thanks!