Leonardo Ethernet not receiving UDP packets

Greetings Gurus, :)

I have a simple sketch which is running fine on Uno with Ethernet shield. I want to port it to the Leonardo Ethernet board as it offers more RAM.

The sketch takes the incoming messages from UDP port and sends them to Serial (Serial1 on Loenardo). It also takes the incoming data from Serial and sends it via UDP.

I'm using Ethernet2.h and EthernetUdp2.h libraries.

As I mentioned it works OK on the Uno, but with Leonardo Ethernet board there is no incoming UDP communication. ThepacketSize = Udp.parsePacket(); always returns 0 (the packets are being sent to it from PC).

The outgoing communication (Serial1 -> UDP) works fine.

Could anyone help?

This library seems to work with the w5500 IC. I don't know much about the Leonardo Eth board though. https://github.com/Wiznet/WIZ_Ethernet_Library

If the Ethernet2.h works with Uno + Ethernet shield (W5500 chip) shouldn't it work as well with any other board based on the Wiznet W5500 chip?

I will try the library you mentioned as well.

Like I said, I am not that familiar with the Leonardo Eth. Do you have a SD card in the slot?

I have installed the library, but it comes with some errors when I compile the sketch:

Arduino: 1.7.10 (Windows 8.1), Board: "Arduino Leonardo ETH"

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Ethernet.cpp: In member function 'int EthernetClass::begin(uint8_t*)':

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Ethernet.cpp:78:3: error: 'W5100' was not declared in this scope

W5100.init();

^

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Ethernet.cpp: In member function 'void EthernetClass::begin(uint8_t*, IPAddress, IPAddress, IPAddress, IPAddress)':

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Ethernet.cpp:123:3: error: 'W5100' was not declared in this scope

W5100.init();

^

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Ethernet.cpp: In member function 'int EthernetClass::maintain()':

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Ethernet.cpp:145:9: error: 'W5100' was not declared in this scope

W5100.setIPAddress(_dhcp->getLocalIp().raw_address());

^

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Ethernet.cpp: In member function 'IPAddress EthernetClass::localIP()':

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Ethernet.cpp:161:3: error: 'W5100' was not declared in this scope

W5100.getIPAddress(ret.raw_address());

^

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Ethernet.cpp: In member function 'IPAddress EthernetClass::subnetMask()':

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Ethernet.cpp:168:3: error: 'W5100' was not declared in this scope

W5100.getSubnetMask(ret.raw_address());

^

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Ethernet.cpp: In member function 'IPAddress EthernetClass::gatewayIP()':

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Ethernet.cpp:175:3: error: 'W5100' was not declared in this scope

W5100.getGatewayIp(ret.raw_address());

^

Error compiling.

The instruction on the GitHub seems to be outdated as well, so I assume that this library is not supporting the W5500 chip (or there is something which needs to be changed there but I don't know what).

I'm not using SD card.

It appears you did not install the library correctly.

My question was not "are you using the SD card?" Be more specific. Do you have one inserted in the Leonardo Eth's SD card reader slot? A SD card inserted into my reader's slot caused me great grief with UDP (NTP client) until I disabled the SD card SPI.

Sorry - there is no card in the slot at all.