Board: Raspberry Pi 3 B+
OS: Raspian Stretch (with desktop and recommended software) 2018-11-13
I'm building an application that requires me to temporarily disable the wpa_supplicant service, while I update the wifi remotely.
Steps
- I run 'sudo systemctl stop wpa_supplicant.service'
- I append a wifi network to the wpa_supplicant.conf using a python script
- I run 'sudo systemctl start wpa_supplicant.service'
- I then have to run 'sudo systemctl restart dhcpcd.service', to see a list of available wireless connections again.
The problem is, even though I have a valid network in my wpa_supplicant.conf, it doesn't automatically try to connect at this point. I have to restart the Pi, and then it properly connects to my saved network.
I have tried 'sudo ifconfig wlan0 down' and then 'sudo ifconfig wlan0 up', but that doesn't do the trick.