How to make Ubuntu 16.04 LTS remember the WiFi password through a shutdown then later restart?
Check that the connection is remembered with a password through the Edit Connections
from the network tray symbol dropdown.
Jump into edit
the connection and on the General
tab automatic connection should be checked. If that's fine, check that there actually is a password remembered in the Wifi-Security
tab.
I feel like there may be more significant issues to your problem though, such as the router failing to authenticate your connection, but this is the first thing to check.