ESP8266-12 running ghost code on its own. Help!

I have flashed the esp-12 with my custom Arduino code. It works great. I control a couple of Solid State Relays with it. No problem there.

What bothers me is something funny indeed. Nowhere in my code, have I specified Wireless Connections. Nowhere! But, right after flashing or even regular restarts, the damn thing connects to my wifi?!? How is that possible?

N.B.: Around 2 weeks ago, I had once played around with the AT command set. I had given it the user/pass. But, I have flashed it, re-uploaded my code a hundred times after it.

How are you determining that it has connected to your wifi ?

I suspect you are going to your router and looking in the list of available connections and there is some latent (old) connection that says ESP ?

Wise ass remark: Maybe it has achieved self awareness. Drive it out into the country and throw it into a field. OK - I got that out of my system.

What code did you flash and what was on the micro prior to your flashing it ?

If you are not using the WiFi radio, turn it off.

This is just how the ESP8266 works. It saves your authentication information to non-volatile memory that is not erased when you upload a new sketch and automatically connects unless you tell it not to in your code. You actually need to set different information to overwrite the previous.

Yes to all your suggestions. Turns out that the ESP doesn’t get “all” of its memory flashed when I re-upload sketches to it. So, I can invoke the EEPROM libs to delete it.

Thanks for your help!