Regarding esp8266

Hi one question from all ...how does esp8266 gets connect to wifi . Like in register level what happens when we write our ssid and password of the wifi router then what happens in register level? And what role does AT commands play in establishing connection with wifi ..is it like the method in by which we can talk to esp8266 and gets connect to wifi with programing it and just sending commands to it.

guptakunal: Hi one question from all ...how does esp8266 gets connect to wifi . Like in register level what happens when we write our ssid and password of the wifi router then what happens in register level?

That sounds to me like a question for the ESP8266 Forum. But I suspect you are not really concerned how your PC implements WiFi at the register level so I can't see that it matters much with the ESP8266 either.

And what role does AT commands play in establishing connection with wifi ..is it like the method in by which we can talk to esp8266 and gets connect to wifi with programing it and just sending commands to it.

If the ESP8266 is programmed to respond to AT commands then they are what instructs it to do different things. I think the ESP8266 is normally programmed to respond to AT commands when it is new. But you can upload a completely different program to it if you want to.

On the ESP8266 Forum you should be able to download a very informative book by Neil Kolban

...R

Indeed, as supplied the ESP8266 is pre-loaded with a program that allows it to be configured and manipulated using AT commands sent via USB/serial. You can configure WiFi as an AP or connect to a router using only AT commands sent via USB/serial if you want. The official AT command set reference can be found here:

https://www.espressif.com/sites/default/files/documentation/4a-esp8266_at_instruction_set_en.pdf

However, the ESP8266 can also be programmed very much like an Arduino. To do this, you will need to download the ESP8266 library which you can do by adding the following to the "Additional Boards Manager URL's" field in preferences:

http://arduino.esp8266.com/stable/package_esp8266com_index.json

You then go to Board Manager and search for the "ESP8266" and install the library. Once you have the library installed, you will then have access to quite a few examples. To access these, first select your ESP8266 board in boards manager, then go to File -> Examples and scroll down to the ESP8266 section. There is plenty there to explore.

Once you compile and upload one of the example sketches or one of your own, the default program will be overwritten with that sketch and the AT functionality will be gone, but you can download the original firmware from here and restore to factory settings if you want to:

https://www.espressif.com/en/products/socs/esp8266ex/resources

Since the program is supplied as a BIN file, you will need a suitable programmer or another Arduino to upload the binary code direct to the ESP8266. This explains how:

https://www.instructables.com/id/Flash-or-Upgrade-Firmware-on-ESP8266-ESP-01-Module/

If you are considering programming the ESP8266 using the Arduino or other IDE, then the API reference here might also be useful:

https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/readme.html

Regarding your second question about the registers, I cannot help, but from my own experience with the ESP8266 I did discover that the SSID and passkey do get stored in a non-volatile way on the ESP chip somehow. This is evident because this information does survive a reboot, however I could not find any information as to exactly how this information is stored. It does not appear to be stored in user accessible program or runtime memory but it can be accessed using specific API calls.

Well as you say that when esp8266 is default program is over-written by third party program .then its AT commands functionality goes way ( which is the way to connect to wifi network ). So now 2 questions...

1) the programs written by third party like one with arduino .. the functions through which we connects to wifi and send and receive data , the function difination of those function does depends on AT commands( But they are gone) or do they depend on the tcp/ip stack( which is the software implementation of our tcp/ip protocol)

2) Now esp8266 has tcp/ip stack which makes us connects to the wifi ??? is this right . if yes then do it contains all the defination of AT commands ( considering using the default firmware). and then when we over write the third party program then its default firmware is erased (which follows At commands ) so with this our TCP/IP stack also goes off?????

Robin2: That sounds to me like a question for the ESP8266 Forum.

On the ESP8266 Forum you should be able to download a very informative book by Neil Kolban

...R

regarding this their i have also raised the issue but till now no one has replied ..it has been a day .

The ESP8266 is a bit like an Arduino with an MCU, GPIO pins and some user program memory where you can upload your own sketches. One key difference however is that the ESP8266 happens to have WIFi hardware on board. This hardware has all the necessary functionality to perform WiFi tasks such as running a WiFi AP, connecting to an existing WiFi network, doing all the necessary tcp/ip stuff as well as DHCP. Its functioning does not depend on the AT commands and you will not break it by uploading your own sketch. The AT command set is, in fact, just a sketch that is factory uploaded to make it possible for anyone to quickly and easily configure WiFi using a serial terminal.

The ESP8266 WiFi hardware is programmed using the ESP8266 library which contains the API’s or the necessary functions for your program to do things like assigning an IP address, setting the SSID and passkey, setting the running mode (AP or station), connecting to an existing WiFi network etc. When you upload another sketch, you do not loose any of the functionality of the WiFi hardware. You are simply replacing the AT sketch, which BTW will also be using functions provided by this library, with your own sketch. The examples I mentioned show you how to do all those things and can be used as a starting point for your own programs. There are also numerous online examples.

I do understand the apprehension at first. You can, by all means experiment with the AT commands, but depending on what you intend to do with your ESP8266, at some point (probably sooner rather than later) AT commands will become insufficient and you will likely need to write a sketch. Serving http pages and passing data from serial over tcp/ip are just a couple of examples of applications where AT commands will just not suffice.

I get the impression that he is concerned that his internet connectivity will be impaired or lost after he overwrites the AT capability by running an 'Arduino' type program.

On the contrary he is going to find out that once he successfully connects his ESP8266 to his router he will have to take special measures to prevent it from reconnecting each time the device powers up.

This action was alluded to at the end of reply #2.

Don

Okay thanks BitSeeker for detailed explanation very helpful .
Just another last thing that where does the role of tcp/ip stack comes then?

floresta: I get the impression that he is concerned that his internet connectivity will be impaired or lost after he overwrites the AT capability by running an 'Arduino' type program.

Don

Its not like that , i want to know that what is happening in the backend that makes the chip connect to wifi. Wifi is just radio waves after all so i want to know how does the IC esp8266 connect to these waves , like is their some register mechanism their also or the role is played by tcp/ip stack

guptakunal: Its not like that , i want to know that what is happening in the backend that makes the chip connect to wifi.

Almost all the details you will ever need are in the book I referred you to in Reply #1

...R