Editing
esp
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===ESP.WiFi=== [https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/station-class.html#table-of-contents ESP8266WiFi Documentation]<br> ESP8266 WiFi stack will save WiFi configuration to flash memory, and automatically reconnect to the same network on restart. This happens even if you aren't using WiFi functions. You can disable persistence by adding '''WiFi.persistent(false);''' in the beginning of your WiFi initialization code. To disable WiFi in a sketch where you don't need it you can use '''WiFi.mode(WIFI_OFF);'''.<br> ====Functions==== =====hostname===== ;Get the DHCP hostname assigned to ESP station. WiFi.hostname() Function returns String type. Default hostname is in format ESP_24xMAC where 24xMAC are the last 24 bits of module’s MAC address. The hostname may be changed using the following function: WiFi.hostname(aHostname) Input parameter aHostname may be a type of char*, const char* or String. Maximum length of assigned hostname is 32 characters. Function returns either true or false depending on result. For instance, if the limit of 32 characters is exceeded, function will return false without assigning the new hostname. Example code: <nowiki>Serial.printf("Default hostname: %s\n", WiFi.hostname().c_str()); WiFi.hostname("Station_Tester_02"); Serial.printf("New hostname: %s\n", WiFi.hostname().c_str());</nowiki> ====WiFi.scanNetworks(true)==== The optional parameter, true, is an instruction to scan in asynchronous mode, i.e. trigger scanning process, do not wait for result (processing will be done in background) and move to the next line of code.<br> [https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/scan-examples.html Example Code]<br> ====WiFi.disconnect()==== WiFi.disconnect() shuts down a connection to an access point that module may have automatically made using previously saved credentials.<br>
Summary:
Please note that all contributions to Notebook may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Notebook:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Home Page
C++ Reference
ESP Hardware
ESPHome
Home Assistant
Network Stuff
Tools
What links here
Related changes
Special pages
Page information