wrcsubers / Arduino_FishFeeder

A simple NodeMCU based Fish Feeder capable of 16 timed feedings. Uses NTP and a simple web server to keep track of feedings.
1 stars 0 forks source link

Get a 404 error when I try to connect to the webserver #2

Open tictocdoc opened 4 weeks ago

tictocdoc commented 4 weeks ago

Hello: I added my WiFi credentials to the .ino file and uploaded it. When I monitor the ESP8266 via the serial monitor I get the following output:

Waiting for WiFi to connect..........

WiFi connected! IP Address: 192.168.1.137

ezTime debug level set to INFO handleFileRead: / File Not Found handleFileRead: / File Not Found handleFileRead: / File Not Found

Not sure what the issue is but I also get a "404 Not found" error when I try to connect to the IP address shown in the serial monitor. Please let me know if there's any additional information you need from me. Thanks for a great project! Mike

wrcsubers commented 4 weeks ago

Hi Mike, Thanks for the compliments =)

This has something to do with how the (very basic) webpage is stored and served. A 404 error basically means that the page isn't found. The webpage is generated by appending strings to the webPageLog string. Are the following lines at least present in your code?

https://github.com/wrcsubers/Arduino_FishFeeder/blob/23ea2ad5559420e3a9188f2159e759d34bee71f6/_Code/FishFeeder.ino#L72-L75

I'll grab my FishFeeder and see how this commit runs on it, I might need to update the code for newer Arduino versions. =)

tictocdoc commented 2 weeks ago

Hello Cameron:

Thanks for the quick reply! The problem may totally lie at my end. I've never flashed a program that utilizes the SPIFFS file system. I've built several 3D printers from scratch and successfully used several ESP8266's for my home automation devices so am familiar with the Ardunio IDE. I'm not clear on how to format the upload. I've looked on YouTube for tutorials. I just checked the code I downloaded from GitHub. I only added my network credentials so no other changes to the code. I even tried rolling back the IDE version to 1.8.19. I just now re-flashed the code and this is what's seen in the Serial Monitor:

[SPIFFS] size : 2024 [SPIFFS] page : 256 [SPIFFS] block : 8192 /FishFeederAIO.html /FishFeederStyle.css /_Images/Feeder.svg /_Images/Feeder_Plain.svg [SPIFFS] upload : C:\Users\micha\AppData\Local\Temp\arduino_build_861075/FishFeeder2B.spiffs.bin [SPIFFS] address : 0x200000 [SPIFFS] reset : --before default_reset --after hard_reset [SPIFFS] port : COM8 [SPIFFS] speed : 115200 [SPIFFS] python : C:\Users\micha\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1\python3.exe [SPIFFS] uploader : C:\Users\micha\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\tools\upload.py

esptool.py v3.0 Serial port COM8 Connecting.... Chip is ESP8266EX Features: WiFi Crystal is 26MHz MAC: 48:3f:da:5f:6d:c9 Uploading stub... Running stub... Stub running... Configuring flash size... Auto-detected Flash size: 4MB Compressed 2072576 bytes to 10668... Writing at 0x00200000... (100 %) Wrote 2072576 bytes (10668 compressed) at 0x00200000 in 0.9 seconds (effective 17621.1 kbit/s)... Hash of data verified.

Leaving... Hard resetting via RTS pin...

I am able to get to the webpage:

I can exit "test mode" and make changes to the feeding time but the changes don't seem to "stick". When I press "start feeder" it takes me back to the "test mode" page. The top of the page always says "waiting for setup" and the date and time don't update to reflect what's shown in the serial monitor.

So it appears that I've made some progress :-). I designed a feeder that only has 7 feeding "stations" so will have to figure out how many steps to advance the stepper to make the hole in the feeding plate line up with the hole in the base of the feeder.

I appreciate you're wanting to help with this. Let me know if there's anything you want me to try on my end.

Best regards.

Mike