Skip to main content
8 of 8
added 1017 characters in body
Gossamer
  • 663
  • 1
  • 6
  • 15

ARP message to enc28j60

I have made the driver for enc28j60 for LPC1788 and I'm trying to send UDP message to LPC via wifi enabled device (iOS, windows over wifi). But transmission fails. Wifi device sends the ARP request. LPC sends the response, but it doesn't arrive. I have checked the ARP cache on windows machine and it stayed empty. When I do the same with cable connected machine, it arrives correctly, ARP cache is populated. That concludes that ARP response is sent and it is correctly built.

I have tried ping as well and same thing, every device that comes via router failed to get ARP response, but devices that are connected by cable receives the ARP response.

But, same enc28 board is working fine with Arduino. Arduino implementation of driver and ethernet was not done by me.

That means that it is somehow related to the driver. I have either forgot to switch some option of enc28 chip or ...

I have looked at Arduino driver but I could not find any obvious error in my implementation.

Any idea what could be wrong?

UPDATE:

I now have Wifi router with tcpdump installed on it. I have run it and sniff the packets from Wifi to Arduino (everything is fine there. ARP request, ARP response and Ping echo/reply can be seen in trace). When i start Wifi to LPC i only see ARP requests. Although it says that few packets are received by the filter, but i cant see those packets in dump file. Is there any option on tcpdump to see raw data ?

What I can see when use tcpdump with "-i any" option, is my lost arp response. But it looks fine to me.

ARDUINO

ARP Request
0004 0001 0006 d89e 3f87 3ad5 0000 0806
0001 0800 0604 0001 d89e 3f87 3ad5 c0a8
0564 7069 692d 3031 c0a8 0508

ARP Response
0003 0001 0006 7069 692d 3031 0000 0806
0001 0800 0604 0002 7069 692d 3031 c0a8
0508 d89e 3f87 3ad5 c0a8 0564 0000 0000
0000 0000 0000 0000 0000 0000 0000

LPC

ARP Request
0001 0001 0006 d89e 3f87 3ad5 0000 0806
0001 0800 0604 0001 d89e 3f87 3ad5 c0a8
0564 0000 0000 0000 c0a8 0507

ARP Response
0003 0001 0006 891d dc9f da6e 0000 0806
0001 0800 0604 0002 891d dc9f da6e c0a8
0507 d89e 3f87 3ad5 c0a8 0564 0000 0000
0000 0000 0000 0000 0000 0000 0000

I dont see any differences in the response from LPC (which doesnt work) and one from Arduino (which works).

Could it be some kind of timing issue ?

LPC

11:39:05.194814 arp who-has 192.168.5.7 tell 192.168.5.113
11:39:05.194889 arp who-has 192.168.5.7 tell 192.168.5.113
11:39:05.195001 arp who-has 192.168.5.7 tell 192.168.5.113
11:39:05.194814 arp who-has 192.168.5.7 tell 192.168.5.113
11:39:05.195537 arp reply 192.168.5.7 is-at 89:1d:dc:9f:da:6e (oui Unknown)
11:39:06.194815 arp who-has 192.168.5.7 tell 192.168.5.113
...

Arduino

11:42:27.712993 arp who-has 192.168.5.8 tell 192.168.5.113
11:42:27.713068 arp who-has 192.168.5.8 tell 192.168.5.113
11:42:27.713180 arp who-has 192.168.5.8 tell 192.168.5.113
11:42:27.712993 arp who-has 192.168.5.8 tell 192.168.5.113
11:42:27.714049 arp reply 192.168.5.8 is-at 70:69:69:2d:30:31 (oui Unknown)
11:42:27.714141 arp reply 192.168.5.8 is-at 70:69:69:2d:30:31 (oui Unknown)  
11:42:27.767303 IP 192.168.5.113 > 192.168.5.8: ICMP echo request, id 56841, seq 0, length 64 
... 
Gossamer
  • 663
  • 1
  • 6
  • 15