The use of the ESP8266 in the world of IoT

User avatar
By mrlightsman
#88355 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.
Last edited by mrlightsman on Mon Aug 24, 2020 5:32 pm, edited 3 times in total.
User avatar
By mrlightsman
#88362 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
User avatar
By mrlightsman
#88377 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.