I'm having trouble connecting to a wifi via python script right now because most tutorials out there are deprecated. There do not seem to be suitable up-to-date python packages anymore thus I plan to use os.system(command) for connection.
But up until now I just cannot find the right method for my requirements. I want to use interface wlan0 to scan available networks and then connect to one via essid and key. I want to maintain a static IP so that I can still find the pi for ssh connection.
The whole connection thing should be rather easy e.g. via network manager nmcli but I struggle to find a right configuration for my requirements (you got to activate the interface in /etc/network/interfaces right??) without either WIFI breaking or the static IP getting lost.
It would be great if someone can recommend any up-to-date method to do this so that I do not try to get things to work which are deprecated.
Thanks in advance and best regards.