• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Web Server problem getting old web page instead of new page

Q&A Forum › Category: ESP32 › Web Server problem getting old web page instead of new page
0 Vote Up Vote Down
Kent McNaughton asked 3 years ago

Hi, I’m using the “Build Web Servers with ESP32 ..” tutorial and am having a problem running code from module 2.1.
I’m using Ubuntu Linux and the Arduino IDE with Mozilla Firefox, but without either VisualStudio or PlatformIO.
The problem is when I try to run to code from module 2.1 “Web Server-Control Outputs”, my web browser shows the HTML results from module 1.3 “Hello World”.
I’ve cleared the Firefox cache, verified the sketch code, the index.html and style.css files and compiled and uploaded the code with the Arduino IDE. I still get the same output in my browser, as if I was running the 1.3 sketch.
Double-clicking the index.html file brings up the correct 2.1 web page on the browser.
My file structure looks like this: (directories noted by a following ‘/’)
$ls ~/ESP32/Web_Server/
1_2_Hello_World_SPIFFS/ 1_3_SPIFFS_Arduino/ 2_1_Output/ data/ src/ /* and some example files for HTML, CSS, and JS code */
/* NOTE: the src/main.cpp files have all been re-named, as I’m using the Arduino IDE */
$ls ~/ESP32/Web_Server/1_2_Hello_World_SPIFFS
data/ 1_2_Hello_World_SPIFFS.ino
$ls ~/ESP32/Web_Server/1_3_SPIFFS_Arduino/
data/ 1_3_SPIFFS_Arduino.ino
$ls ~/ESP32/Web_Server/2_1_Output/
data/ 2_1_Output.ino
$ls ~/ESP32/Web_Server/2_1_Output/data/
favicon.png index.html style.css /* index.html and style.css both checked to be 2.1 code */
I suspect the file structure may be wrong (but don’t know how I’m getting the web page from the previous module), or somehow, a cached page is being used.
Any ideas?

3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi Kent.
 
Check the following:
1) First, try hard resetting your web browser. Search “hard reset Firefox”
2) Open the JavaScript console in your browser and check if there are any errors.
3) Double-check that you have the right folder structure. If you’re using Arduino IDE, you should have a folder called data inside your sketch folder. Inside that data folder you should place the HTML and CSS files.
4) Make sure you upload the files in the data folder to the board. Tools > ESP32 Data Sketch Upload.
5) After uploading the new code and files, reset your board by pressing the ESP32 on-board RST button.
 
I hope this helps.
Let me know if this solves your issue.
 
Regards,
Sara
 

0 Vote Up Vote Down
Kent McNaughton answered 3 years ago

4) Make sure you upload the files in the data folder to the board. Tools > ESP32 Data Sketch Upload.
That did it!
As I recall, I was just using the Arduino sketch upload. The data files were, no doubt, left over from the previous module.
Thank you, Sara.
You can close this case.
Best, Kent

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Great.
I’m glad the issue is solved.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.