I am using a basic OTA code to upload code upgrades to my ESP8266 over network. It is working as intended but now i have a new challenge.
Right now my ESP8266 is running on network #1, my home network. ESP8266 connects to my network over wifi and runs OTA and also a basic HTML server. Now i have to move this ESP8266 to network #2, which means i have to code into it a new SSID name and new SSID password. The IP will remain the same. So my question is, will this work:
1) I upload code to ESP8266 over network #1 as i do now (both ESP8266 and PC connected to network #1). In this upload, i change SSID name and password from network #1 to network #2. Obviously this means i can no longer access my ESP8266 OTA since ESP8266 is not connected to network #1 anymore.
2) Now i change location and move my ESP8266 near network #2 - so now ESP8266 connects to network #2 and also my pc. I connect my pc also to network #2. Can i upload my code over OTA now, as i did before ?
I hope you understand what i mean. Its quite simple really. ESP8266 is inside a box, which means connecting it with USB cable is messy - right now ESP8266 is connected to 5V through microusb, also opening the box risks unplugging some wires. So that is why i use Basic OTA to upload small code corrections to ESP8266. But i am doing that at home on my home network. Now i need to take this ESP8266 box to another place where they have a different network. So my plan was to simply input new ssid name and password into ESP8266 at home and then take this ESP8266 box to another place and hopefuly it will connect to new network. What i fear is that changing the network will somehow prevent me from using arduino IDE to upload code to it. Right now in my program i have an ip adress of ESP8266 that i can choose, next to port selection.