I have recently started having issues with a laptop device (running Ubuntu 22.04) on the local WiFi network being unable to connect to two separate Android devices (both running SSHelper). On my first attempt, when I tried to ping android1 from laptop, I kept getting the error "Destination Host Unreachable". But when I tried to ping laptop from android1 after about 5 or 10 of the same error message, suddenly it started working!
But then when I tried the same approach from laptop to android2, it did not work. After pulling a bunch of hairs I thought to try manually adding the MAC address of android2 to the ARP table on laptop (arp -s) and suddenly it started working! A couple of hours later I tried to connect from laptop to android2 and it wasn't working again. The ARP table was still in the same state. This time I was able to get it to work by adding the MAC address of laptop to the ARP table on android2! (Fortunately android2 is a rootable device!)
While this is a workaround until I get to the bottom of why it doesn't work, it doesn't solve the problem longer term. In addition, it seems like every workaround I find stops working after while and I am about of things to try! How can I trouble shoot the issue? I've already tried rebooting all devices (this is actually the first thing I tried as in the past I seem to recall it did work), I have looked at the network routes, the subnet masks, the ARP table (which says "incomplete" until I manually force it in there.) I feel like there may be some issue with broadcast packets or something - could it be possible that there is an issue with the WiFi network?