Is prossibel to change wifi setting after update sketch in esp8266nodemcu


(Sanjay Panchal) #1

hello,
is possible to change wifi setting after update sketch, i have two esp8266node mcu and is working good, but every time i change my wifi router setting all esp8266node mcu , going disconnected , is any way to change wifi setting in esp8266node mcu


(Lucky) #2

If you upload a sketch that allows wifi to be changed, then yes.


(Sanjay Panchal) #3

thanks for reply , luckymallari

can you share link for how to change wifi setting after upload, i am new in Arduino, so link help me lot


(Moxified) #4

You probably need to setup Over the air update. http://esp8266.github.io/Arduino/versions/2.0.0/doc/ota_updates/ota_updates.html

You can either reconnect via serial and upload the sketch again with the new wifi settings which is probably what you are doing or you can start using OTA which will allow you to upload settings via wifi.

Either way, you will need to flash a new sketch with OTA prior to being able to do OTA.

Then the future process would be:

Use OTA to flash sketch with proposed wifi changes to all of your devices. Once they reboot, they will be looking for the new wifi settings and therefore will be disconnected…
Once all are updated, change your wifi settings on your AP/Router.
Devices should reconnect once the new settings are in place on your router. You may have to power cycle your devices depending on how good your wifi reconnect code is.


(Lucky) #5

I always use OTA for uploading new sketches but OTA is overkill if all u want to do is change WiFi settings. Just setup a webserver on the ESP and change the WIFI that way.


(Moxified) #6

Link to example of your method? How does this webserver persist these changes?


(Lucky) #7

@Moxified
this and at least try to search


(Moxified) #8

That’s completely uncalled for Lucky… but I’m not surprised I suppose as you are peppered around this forum with grumpy responses especially to newbies. Your initial response was basically useless so I offered a path to get him going.

My point was that you called OTA overkill but didn’t give any links to your golden better method. You know best what you mean by your previous post… give the guy a seed link to get him going. Not everybody has the same background knowledge to point their google skills in the right direction.

I wasn’t even asking for me cause I don’t care. I have a solid mqtt esp setup and I don’t mess with my wifi settings regularly so I wouldn’t need this.

I’m not a newbie and I have been around here longer than you so don’t be a jerk.

For those that are interested in Lucky’s link without the “let me google that for you” high-school crap… here is a tutorial on esp eeprom:


(Lucky) #9

Hmm. My bad if i may have pushed the wrong button but I see that you clicked the first link but not the second one. As you nitpicked my reply, I could also asked, why not assist the OP in the first place? Peppered? I’d take some salt also because I know how to stand my ground. I love helping around here, but as you may see in the second link, i don’t condone spoon feeding. lets move on. It’s the webz. As you can also notice, whatever I did/posted above worked, didn’t it?


(Moxified) #10

Whatever man. You links were uncalled for. I clicked both too. Not sure why it didn’t highlight both. The second link was less rude but irrelevant so I made no mention of it.

Nobody was asking for spoon feeding, just a little clarification on a vague statement.

At the end of the day, it’s not a big deal, just no need for what I see as a rude response to my valid question to bring clarification.


(Lucky) #11

Rude? Lol. Compare your post to mine. But yeah I agree, whatever, right?