Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ESP8266 Home Automation Projects

You're reading from   ESP8266 Home Automation Projects Leverage the power of this tiny WiFi chip to build exciting smart home projects

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher Packt
ISBN-13 9781787282629
Length 196 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Constantin Tambrea Constantin Tambrea
Author Profile Icon Constantin Tambrea
Constantin Tambrea
Catalin Batrinu Catalin Batrinu
Author Profile Icon Catalin Batrinu
Catalin Batrinu
Arrow right icon
View More author details
Toc

Using the WiFiManager library

Until now the SSID and password for connecting the ESP8266 to the Wi-Fi network have been hardcoded in the sketch using these lines:

const char* ssid = "YOUR_WIFI_SSID"; 
const char* password = "YOUR_WIFI_PASSWORD";

To stop using the hardcoded values we need to first start the ESP8266 in AP mode and expose the user as a web interface served by an embedded web server hosted inside the ESP8266.

We will learn how to use the WiFiManager library to expose a configuration web page; we will take the data and save it to a SPIFFS like we did in the previous chapter and use it to start our module in station mode and connect to an MQTT server.

If you didn't install the WiFiManager library in Chapter 1, Getting Started with the ESP8266 you can do it now, going to Sketch | Include Library | Manage libraries and search...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime