Have you ever been able to connect or is this a new machine? Check your network settings for encryption. For some reason mine wouldn't connect to the WPA2-TKIP so I had to switch it to AES and it worked after that.
Oops. Sorry. That was the issue for my Vita up above.
My PS4 had another issue.
I had my frequency set at 5 GHZ initially. PS4s CANNOT operate on that frequency. 2.4 Ghz ONLY. Took me a while to figure that one out. Had to drop my network frequency to that level.
Check and see if there is a firmware update for your router, you may also temporarily hard wire the PS4 and see if any pending updates resolve the issue.