ethercard problem using static IP configuration (SOLVED)


I have been trying to make various progams working with a static configuration and that does not work. When I use DHCP it works.

In static configuration the function dnsLookup hangs . The isLinkUp function never returns true!

What is strange is that it was working months ago. I am updating my programs (I updated the libs first) and then it hangs ...

In order to understand I tested various exemples provided with the lib. The ones with the DHCP config work. I tried the getViaDNS this one uses a static config

I changed the IPs to the ones in line with my network. It does not work dnsLookup hangs. I tried also providing the DNS IP that changes nothing.

Have you noticed such problem?

Could you give me a hint on where to look at ?

Thanks Shasha

The EtherCard fixed a bug in the DNS in januari 2015, but someone had still trouble with the wrong DNS a week ago. I could not replicate that, it working here.

I updated the ethercard lib 3 days ago so I should have the fix if any has been done.

I saw in various posts people having problems with DNS in the DHCP config. Nothing with the static config.

Some news:

I checked the dnsLookup function isLinkUp does come true after about 60ms.

then I looked further and I noticed that the netmask was needed !!

In the exemple the netmask was not configured so I did had it.

And .... with the netmask it works !!!

so problem solved (in my old working sketches it was not required hence my surprise !!!)

Thank shasha for your idea - unused mask parameter ;-) I have LAN with MASK and with static setup EtherCard not working, but static IP without mask is OK.