Verify firmware version (as requested by dc42).
After some time struggling, I found this to be the best method to set Wifi parameters and successfully join a wireless network.
Verify device is in range of the wifi router
Avoid close proximity to multiple routers and multiple SSIDs
Start a terminal session (YAT) connected via USB
M587 (List ALL stored networks)
If there are any networks listed that you do not want your device to access they need to be removed from the List of Available Networks (M588 gcode)
I removed ALL that were listed. Completely clearing the list.
I had to remove them one by one since the M588 S"*" gcode didn't work for some reason
M588 "what ever net name is there to be removed" (remove network from the stored network list) (MUST be typed verbatim (letter for letter) and inside quotation marks ("))
<<<Edit: M588 S"*" works as expected to remove all networks.>>>
Once the list of stored networks is clean add you wifi network information (M587 gcode)
M587 S"SSID" P"NetPass" (set YOUR network wifi credentials)(MUST be typed verbatim (letter for letter) and inside quotation marks ("))
If the SSID or Password has spaces or funky characters (anything other than 0-1, a-z, A-Z) you may experience issues. Make sure the SSID and Password are typed EXACTLY the same as what the router is expecting. To rule out typos, try changing SSID and Password to something less exotic. Remove spaces and funky characters.
Finally, once the network list is clean (M588) and you have successfully joined the wifi network (M587) Launch network services (M552 gcode)
M552 S1 (launch wifi, Duet will obtain IP address)
The terminal session will display the IP of the Duet, connect to DWC via a browser.
Further reading -