ENC28J60 Ethernet Module ping when directly connect to PC(Windows))

Here I'm using the ENC28J60 ethernet module and the Arduino UIPEthernet library. What the problem I'm facing means when IP pings when directly connected to the PC, but when I'm connecting to the switch it is not pinging properly. Let me know the solution to this.
Thanks.

is the Ethernet module using static IP addresses or DHCP?
is it on a different subnet?
post your code?

Here My code

#include <UIPEthernet.h>

EthernetClient client;
signed long next;

void setup() {

  Serial2.begin(9600);

  uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
  IPAddress myIP(192, 168, 1, 157);
  Ethernet.begin(mac, myIP);

  Serial2.print("localIP: ");
  Serial2.println(Ethernet.localIP());
  Serial2.print("subnetMask: ");
  Serial2.println(Ethernet.subnetMask());
  Serial2.print("gatewayIP: ");
  Serial2.println(Ethernet.gatewayIP());
  Serial2.print("dnsServerIP: ");
  Serial2.println(Ethernet.dnsServerIP());

  next = 0;
}

I have same problem using UIPEthernet.h in that ping does not work when connected to my router

C:\Users\xx>ping 192.168.1.157

Pinging 192.168.1.157 with 32 bytes of data:
Reply from 192.168.1.2: Destination host unreachable.
Reply from 192.168.1.68: Destination host unreachable.
Reply from 192.168.1.68: Destination host unreachable.
Reply from 192.168.1.68: Destination host unreachable.

Ping statistics for 192.168.1.157:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)

if I change the include to use Ethernet.h

#include <Ethernet.h>

I get

C:\Users\xx>ping 192.168.1.157

Pinging 192.168.1.157 with 32 bytes of data:
Reply from 192.168.1.157: bytes=32 time<1ms TTL=128
Reply from 192.168.1.157: bytes=32 time<1ms TTL=128
Reply from 192.168.1.157: bytes=32 time<1ms TTL=128
Reply from 192.168.1.157: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.1.157:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

note I have to power the router OFF/ON when I change from UIPEthernet.h to Ethernet.h or the latter does not work
try using Ethernet.h?
be interesting to know if anyone else has had problems with UIPEthernet.h

I'm using ENC28J60 Module. but Ethernet.h library will support to ENC28J60 Module?

have a look at Arduino ENC28J60 Ethernet Module which mentions a ENC28J60 library

EDIT: just tested a ENC28J60 and the UIPEthernet Library works OK (chatServer, echoServer, webServer)
the ENC28J60 will connect to my new router and get an IP using DHCP
my old Ethernet Shield V1 would not work with the new router at all - had to use one of my old routers with it

I'm using Atmega4808 . The library you suggested is not working for me. Its working only in UIPEthernet Library only

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.