Multiple Webpages on ESP8226

Hello,

I have been using the ESP8226 WiFi Module made by Adafruit in the Ardunio Environment. Everything
works using samples from internet. I can communicate with it and create web page turning on LEDs
and reading sensors.

But I need help creating more than one Web Page to communicate with my device. I have extensive
knowledge of C and that is the reason I like the Ardunio Environment.

I have been checking out many website as well as Ardunio Examples and Libraries without any Luck.
There are so many different methods of programming the ESP8226 that has made my head spin.
My problem is when I try to communicate with more than one Web page.

I am thinking of doing this is 2 ways.

  1. Create all the pages inside the ESP8226 WiFi module.
    So every time a user connects to it, the web pages come alive and the user selects what he wants
    to do.

The problem I have is I do not know how to go from one page to another. For example if I have
a main page and 5 other pages, then how do I go from the main page to any of the other pages?

  1. Another way would be to create a Website outside the ESP8226. The user would go to different
    pages and sends just commands to the ESP8226. Then the ESP8226 would turn on LEDs or would
    send back a temperature reading. All the Web Pages would be outside the ESP8226 module.
    The module would just responds to commands and sends back data.

I think the second method is much cleaner and easier to modify later on the future. Because then
I don't have to update web pages inside the ESP8226 module anymore. I can just modify the Web pages outside to do different things. I also know how to create hyperlinks to go from one page to another.
This way the Web pages can be used as an APP to be used on phones in the future.

Please let me know what you think.

I need to know if anyone would like to help me out on the side.

Thanks

Bobby

do you use or want to use the ESP8266WebServer?
do you want to store the page sources in the internal file system of the esp8266?
here is a complex esp8266 WebServer as example

pages WiFiLink-Firmware/ArduinoFirmwareEsp/data at master · arduino-libraries/WiFiLink-Firmware · GitHub

here is the WebServer in my project. it is programmed without ESP8266WebServer library to work with other networking libraries then esp8266 native WiFi

pages Regulator/Regulator/data at master · JAndrassy/Regulator · GitHub

my WebServer can work in boot modes you described. pages in Arduino (on SPIFFS or SD) or on other server or local files.

Hello,

I tried your

and

project.

I added all the files from

into the WebServer.ino program. Ardunio created a "data" sub directory and added them all there.
But When I tried to compile the WeServer.ino program, I get an error that says "IPAddress" was not declared in this scope".

Do you have any idea why I get the error message.

Thanks

Bobby

bahram:
Hello,

I tried your

WiFiLink-Firmware/ArduinoFirmwareEsp/WebServer.ino at master · arduino-libraries/WiFiLink-Firmware · GitHub
and
WiFiLink-Firmware/ArduinoFirmwareEsp/data at master · arduino-libraries/WiFiLink-Firmware · GitHub

project.

I added all the files from
WiFiLink-Firmware/ArduinoFirmwareEsp/data at master · arduino-libraries/WiFiLink-Firmware · GitHub

into the WebServer.ino program. Ardunio created a "data" sub directory and added them all there.
But When I tried to compile the WeServer.ino program, I get an error that says "IPAddress" was not declared in this scope".

Do you have any idea why I get the error message.

Thanks

Bobby

both WebServers are part of a larger project with multiple ino files. it was meant as source example, not to run it. even though you can try the WiFi Link firmware as a sketch: