I have tracked down why my Pi3 will connect to my WiFi OK to start with then stops working. (see also “After first reboot, cant access musicbox.local”).
After the SD image is written one edits the “settings” file to include the SSID and WiFi password for the Local LAN.
# --------------------
# | Network Settings |
# --------------------
[network]
# Settings for your WiFi network, if you use a (supported) wifi-dongle
# Only supports WPA security, no WEP or access points without security (dive into the command line for that!)
wifi_network = XXXX Wireless LAN
wifi_password = xxxxxxxxxx
This works fine and the Pi connects fine and will continue to do so boot after boot.
At the same time one can set a new Pi system password:
# ---------------------
# | MusicBox Settings |
# ---------------------
[musicbox]
# To secure your device, change the default password to something else.
# For security, the value in this file will be automatically cleaned out when the password is set in MusicBox
root_password = BBBBBBB
----------------------------------------------------------
This too works fine and you can log into the Pi console using ID = root, PW = BBBBBBB
AND the clear text
root_password = BBBBBBB
is converted to
root_password = ""
in the settings file (for security).
This works fine and the Pi connects fine and will continue to do so boot after boot.
However, If you use the Web interface and say turn on SSH using it, then save and reboot,
When it reboots the Pi will no longer connect to WiFi.
When I looked at the settings file I noticed that the WiFi password “xxxxxxxxxx” had been replaced by the system password “BBBBBBB” in this file
# --------------------
# | Network Settings |
# --------------------
[network]
# Settings for your WiFi network, if you use a (supported) wifi-dongle
# Only supports WPA security, no WEP or access points without security (dive into the command line for that!)
wifi_network = XXXX Wireless LAN
wifi_password = BBBBBBB
Obviously after this the system will no longer connect to the LAN.
The problem seems to happen whenever you use the web interface to change the system settings.
Hope this helps and that you will be able to fix it.
F.