Project

General

Profile

ethercard - can't ping local IP, can ping external IP???

Added by Dauhee over 6 years ago

Hi All,

I’m using EtherCard with ENC28J60 and Arduino Uno. All of the samples are working perfectly and I have a good grasp on whats going on. When I tcpSend to a local server (Raspberry Pi) on my public IP and port forwarding from my router, it works great i.e.
ether.copyIp(ether.hisip, someip);
where someip = {89,111,xx,xx}
My router redirects my port (5000) to my internal server and all is good between Arduino and server

However, when someip = {192,168,1,5} which is the direct location of my internal server, there is no connection. I can see on wireshark that something is being sent out. I know there is connectivity on the network, because the server can ping the Arduino, but not the other way.

This appears something low level in EtherCard that is beyond my capabilities. Is there anybody out there that can assist? I’m pulling what little hair I have out!

Thanks,

Dauhee.


Replies (10)

RE: ethercard - can't ping local IP, can ping external IP??? - Added by martynj over 6 years ago

@Dauhee, perhaps posting a screen grab from WireShark will help?

RE: ethercard - can't ping local IP, can ping external IP??? - Added by Bingo over 6 years ago

Is your mac address legal , is your arp handling ok (both on the ENCxx) ?

/Bingo

RE: ethercard - can't ping local IP, can ping external IP??? - Added by Dauhee over 6 years ago

Hi Bingo,

Thanks for that - using the JCW example mac and also changed in case there were clashes etc. I turned off router firewall also. Still no success.

Hi Martynj,

I’ve attached a screenshot of the capture that doesn’t work. The only difference between that and the one that does work, is the IP address.

I’m all out of ideas here :(

Thanks,

Dauhee.

wireshark.png (119 KB) wireshark.png wireshark example
1339

RE: ethercard - can't ping local IP, can ping external IP??? - Added by JohnO over 6 years ago

What network mask are you using on your 192.168.1.n network?

RE: ethercard - can't ping local IP, can ping external IP??? - Added by Dauhee over 6 years ago

Hi JohnO

its assigned by local router DNS of 255.255.255.0

RE: ethercard - can't ping local IP, can ping external IP??? - Added by JohnO over 6 years ago

That’s the default, fine. Is your server also IP configured by the router - using DHCP? What does the ifconfig output look like?

RE: ethercard - can't ping local IP, can ping external IP??? - Added by Dauhee over 6 years ago

Hi JohnO

Yes all clients obtain lease from DHCP on router. All get same subnet, gateway etc

RE: ethercard - can't ping local IP, can ping external IP??? - Added by Dauhee over 6 years ago

tried a different router and it worked. am gutted as really hoped to use this but is too unstable for what I’m looking for. Will have to look at alternatives :(

RE: ethercard - can't ping local IP, can ping external IP??? - Added by JohnO over 6 years ago

That is strange, the router should not be directly (other than DHCP) be involved in dialogue between devices on your local LAN.

RE: ethercard - can't ping local IP, can ping external IP??? - Added by JohnO over 6 years ago

I guess your DHCP isn’t completing correctly.

    (1-10/10)