Open ColinDexter opened 2 years ago
This issue is requesting a new feature - automatic ARP cache invalidation when link status changes. It should not be hard to implement however it will take more code and since few people have requested it disabling by default may be a good idea.
Okay, thanks. Only I have no idea how I can do an "automatic ARP cache invalidation". Hopefully this feature can be added in the future.
For the moment, you could for example reinitialize the library if a ping fails, which should have the intended effect.
I already do an ENC28J60::initialize on a disconnect but that doesn't solve the problem.
You could try:
void(* soft_reset) (void) = 0;
... soft_reset();
)Ultimately if you are unable to reset the ARP cache or resolve via reset I don't think you will get far with this solution as it is not really polished in so far as usability for those sorts of edge use cases and is not receiving a lot of development effort anymore. If you really need rapid plug-and-play between networks without skipping a beat you may be best served by looking toward alternate stacks or hardware.
Sorry, I can program a bit, but this is going to be a little above my level.
If I switch to another network (without turning off the Arduino and ENC28J60) I do get the new IP data from the DHCP. But when I request a website, the destination MAC address of the old DNS server remains in the Ethernet II package instead of the MAC of new DNS server. (verified with Wireshark.)
I can't find where this is set. Apparently this does not reset / set properly when reconnecting to the other network .