I have searched this forum and done a lot googling, and tried many variation of setting this up but have not succeeded yet. I am trying to use the dhcpcd method with RPi 3. Stuffing it all in interfaces was the 'old' method, but I need to do it properly.
What I need is to be able to connect to 2 WiFis at home with static IP and then use DHCP when I am at work (and perhaps several more locations). I have reset /etc/network/interfaces to the default and set up wpa_supplicant.conf with a single WiFi and /etc/dhcpcd.conf with static IP for eth0 and wlan0. This all works. What I now want to do is add the other 2 WiFi networks, one static and the other DHCP.
Do I need to change interfaces to show wpa-roam instead of wpa-conf? How, and where, do I make the distinction between static and DHCP for the various network-ids? Someone must have got this working!