I thought I'd post this in case anybody else finds it useful. The wifi connectivity used to work but recently stopped working.
The icon for wifi connectivity would flash but it would never sync automatically. Attempting a manual sync just got stuck on 'connecting'.
Attempting to change the password for wifi from the device, resulted in 'connection failed', as did removing and trying to re-add the network.
What did work was plugging it into Garmin Connect on a PC. Bizarrely, trying to update the password from there resulted in a duplicate network being created. I then deleted the old one. Wifi connectivity now works again.
Again, I hope this helps anybody else with the same problem on an 540, 840 or 1040.