How does Arduino IDE write to ESP8266 register?

Hi. I'm using the ESP8266 Wi-Fi module to retrieve data from Firebase Realtime Database. I was wondering if the Arduino IDE or the code in the library actually wirte to the register of ESP8266 to make the Wi-Fi connection and send http request to Firebase. If it does write to the register of the ESP8266, may I know where can I find those code? (When I was reading the code, I didn't see any statement that write to the register of ESP8266.)

I'm using the library from this link.

Any help would be appreciated.

I was wondering if the Arduino IDE or the code in the library actually wirte to the register of ESP8266 to make the Wi-Fi connection and send http request to Firebase.

The ESP cores makes the wifi connection, and a few ESP core libraries create the http request (see within FirebaseHttpClient_Esp8266.cpp ) The Firebase library creates the URL specific to the request the response is handled by the core initially and then dealt with in more detail by the library. Note that the Firebase library has specific .h files for the ESP which #include <ESP8266WiFi.h> && #include <ESP8266HTTPClient.h>

the Espressif SDK interfaces the WiFi part. and the SDK is not open source

Deva_Rishi:
The ESP cores makes the wifi connection

Deva_Rishi:
The Firebase library creates the URL specific to the request the response is handled by the core initially and then dealt with in more detail by the library.

When the core and the library are doing these things, do they actually write something the the register of the ESP8266? As what we did for all microcontroller, we always need write to the register for the microcontroller to tell it to do something right? Is the same thing applies for ESP8266?

Juraj:
the Espressif SDK interfaces the WiFi part. and the SDK is not open source

I'm sorry, I don't understand this. Could you please elaborate more on this?

pauline95:
When the core and the library are doing these things, do they actually write something the the register of the ESP8266? As what we did for all microcontroller, we always need write to the register for the microcontroller to tell it to do something right? Is the same thing applies for ESP8266?

What do you mean by THE register? I'm sure the device has hundreds of registers, which one are you interested in?

Moreover, what problem are you trying to solve?

pauline95:
I'm sorry, I don't understand this.

"The WiFi" is done by software uploaded with your sketch - a library from Espressif esp8266 SDK (Software Development Kit). The linker script of esp8266 Arduno core adds it to your sketch. Did you see how large Blink is?
hardware is only antenna and signal processing circuit with specialized DAC/ADC

Juraj:
"The WiFi" is done by software uploaded with your sketch - a library from Espressif esp8266 SDK (Software Development Kit).

So you mean the library from Espressif is handling things like connecting the ESP to the Wi-Fi router and making internet connection? Isn't that being done by the ESP8266WiFi library?

gfvalvo:
What do you mean by THE register? I'm sure the device has hundreds of registers, which one are you interested in?

Moreover, what problem are you trying to solve?

My problem now is that I actually don't know what registers are involved in handling the internet things. To be more precise, I don't know what are the registers involved in connecting the ESP to the Firebase and I'm interested in seeing the code that deal with those registers.

pauline95:
So you mean the library from Espressif is handling things like connecting the ESP to the Wi-Fi router and making internet connection? Isn't that being done by the ESP8266WiFi library?

no, the WiFi library is only a thin layer over the SDK handling WiFi and LWIP handling TCP/IP. it is complex, complicated, deep and wide.

https://savannah.nongnu.org/projects/lwip/

pauline95:
My problem now is that I actually don't know what registers are involved in handling the internet things. To be more precise, I don't know what are the registers involved in connecting the ESP to the Firebase and I'm interested in seeing the code that deal with those registers.

the registers are for generic 2.4 GHz RF transmit and receive. they are not documented. no magic WiFi registers.

Juraj:
no, the WiFi library is only a thin layer over the SDK handling WiFi and LWIP handling TCP/IP.

I try to conclude what you explain, please correct me if I'm wrong. So, the Wi-Fi library is handling simple things such as allow the programmer to set the Wi-Fi password, Wi-Fi SSID, enabling WEP encryption, etc.? Basically allowing programmer to do the setting that they want? And after the programmer done all those setting, the library in Arduino will interact with the library from Espressif, then the library from the Espressif will do the complicated stuff of giving instruction to the ESP to perform the Wi-Fi function?

And from this link that you have provided: https://www.espressif.com/sites/default/files/documentation/2c-esp8266_non_os_sdk_api_reference_en.pdf, I read about this:

The non-OS SDK provides a set of application programming interfaces (APIs) for core ESP8266 functionalities such as data reception/transmission over Wi-Fi, TCP/IP stack functions, hardware interface functions and basic system management functions.

Is the API here same as the library from Espressif that you mentioned previously?

the SDK API is in C. no classes no objects. only structs and functions, a long list of functions. The ESP8266WiFi library uses C++ to create a more convenient API in Arduino style.

in WiFi part the SDK API wrapping is very straightforward. example (the lowercase named function with _ are SDK functions)

bool ESP8266WiFiSTAClass::reconnect() {
if((WiFi.getMode() & WIFI_STA) != 0) {
if(wifi_station_disconnect()) {
return wifi_station_connect();
}
}
return false;
}

In the TCP/IP part (WiFClient, WiFiServer, WIFiUdp) the esp8266 Arduino core developers replaced some parts of SDK with open source version of LWIP so there is the SDK API used a little deeper

Juraj:
bool ESP8266WiFiSTAClass::reconnect() {
if((WiFi.getMode() & WIFI_STA) != 0) {
if(wifi_station_disconnect()) {
return wifi_station_connect();
}
}
return false;
}

Thank you for being patient in explaining these things. From the code above, is that correct if I interpret it as the code in ESP8266WiFi library is actually using the SDK functions?

Juraj:
"The WiFi" is done by software uploaded with your sketch - a library from Espressif esp8266 SDK (Software Development Kit). The linker script of esp8266 Arduno core adds it to your sketch. Did you see how large Blink is?

Regarding this that you mentioned previously, I found something similar on this website: How to program the ESP8266 WiFi Modules with the Arduino IDE (Part 2 of 2) – 42 Bots

In that website, I read about this:

There are two parts to the program that you are loading: your compiled sketch and the ESP8266 binary firmware to support the low-level API calls to the ESP8266.

Is this the same concept as what you explained previously? Is the ESP8266 binary firmware provided by Espressif and is included in esp8266 Arduno core?

pauline95:
Thank you for being patient in explaining these things. From the code above, is that correct if I interpret it as the code in ESP8266WiFi library is actually using the SDK functions?

Regarding this that you mentioned previously, I found something similar on this website: How to program the ESP8266 WiFi Modules with the Arduino IDE (Part 2 of 2) – 42 Bots

In that website, I read about this:

There are two parts to the program that you are loading: your compiled sketch and the ESP8266 binary firmware to support the low-level API calls to the ESP8266.

Is this the same concept as what you explained previously? Is the ESP8266 binary firmware provided by Espressif and is included in esp8266 Arduno core?

yes and yes

Juraj:
yes and yes

So since the ESP8266WiFi library is using the SDK function, the SDK will do the job of writing to the registers to achieve the wifi function?

Juraj:
In the TCP/IP part (WiFClient, WiFiServer, WIFiUdp) the esp8266 Arduino core developers replaced some parts of SDK with open source version of LWIP so there is the SDK API used a little deeper

So the Espressif SDK originally has its own function to handle TCP/IP, but the Arduino core developers replace the function from Espressif SDK with lwIP which is a collection of open source function? My understanding for lwIP is that it's a smaller version of TCP/IP stack and stack is considered software?

pauline95:
So since the ESP8266WiFi library is using the SDK function, the SDK will do the job of writing to the registers to achieve the wifi function?

So the Espressif SDK originally has its own function to handle TCP/IP, but the Arduino core developers replace the function from Espressif SDK with lwIP which is a collection of open source function? My understanding for lwIP is that it's a smaller version of TCP/IP stack and stack is considered software?

I wrote earlier that it is all software. the hardware is only 2.4 GHz radio frequency transmitter and receiver