-->
Page 1 of 3

Webserver not working after updating Arduino IDE and ESP8266

PostPosted: Tue Aug 18, 2020 12:55 pm
by mrlightsman
About a year ago I developed some code which ran fine. I recently pulled it out, updated Json5 to Json6 and compiled the code on the newest release (1.8.13) of Arduino IDE and ESP Boards(2.7.4). I also Updated all Libraries.

Now the Webserver will not respond. WifiMulti is connecting to internet and Websocket is communicating. I just cannot reach the webserver page, either in AP mode or client mode through DHCP assigned IP address.

Other than a few lines of code in the SPIFFS routines to update to Json6, I did not change anything.

Below is the code. I am a novice coder, so it is very sloppy. I heavily commented it to assist with this post. (I accept the criticism. I know this is amateurish. I just really need the help.)

I have included the full code, but really am looking for advice with the webserver. (Any other thoughts are also appreciated, but webserver is key.)

Thank you in advance for your help.

Code removed. Thanks for the help.

Re: Webserver not working after updating Arduino IDE and ESP

PostPosted: Tue Aug 18, 2020 2:53 pm
by rudy
Have you tried the modified code with the previous version of the ESP8266 version? (the one you had before the upgrade)

Re: Webserver not working after updating Arduino IDE and ESP

PostPosted: Tue Aug 18, 2020 8:27 pm
by mrlightsman
Thanks for the quick reply Rudy. I backed off the board to 2.7.0 and it still did not work. I then tried the example webserver sketch and it worked fine.

Seems like I broke something in this version of the code... beyond my original problem. I’ll take a fresh look at it and post up some new code tomorrow.

I must have really broken something now since it won’t even connect to WiFi now. It seems to keep resetting. At least an earlier version was connecting and allowing websocket connection.

I’ll post up new code tomorrow. I don’t want to waste your time on my mistakes. I’ll really need you help later. Thanks

Re: Webserver not working after updating Arduino IDE and ESP

PostPosted: Wed Aug 19, 2020 8:42 am
by mrlightsman
I fixed the code this morning and got things back to where they were... WiFi connects, Websockets communicate, but webserver does not respond. I updated the code in the original posting.

From what I can determine, when I call on the webpage from a browser, it causes the ESP to crash and restart. Oddly, the file not found response works correctly (which is the only webpage that doesn't involve Json).

I didn't change anything in this section of the code. My theory is that since the string that constructs the webpage is built using variables stored in SPIFFS through Json, that it crashes because I've done something wrong in Json. (I build the pages beginning with line 486.)

I handle Json and SPIFFS with the readjson() (line 234) and savejson() (line 186) routines. SPIFFS is initially setup in setup() (line 746).

Again, thank you for your help. I am puzzled about what I have done top break this.