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?
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
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