Integrating Web Servers | netconn APIs vs. HTTP Server Component
Posted: Sat Mar 07, 2020 7:02 pm
I'm currently using two web servers, one for wifi management and the second for firmware updates, and I need to integrate them one way or another so that I am only using one web server. I have little experience working on this topic, so I could really benefit from suggestions on which way to go.
The wifi manager https://github.com/tonyp7/esp32-wifi-manager: uses netconn functions to serve the HTML page and to support GET/POST requests from a javascript file (code.js in the repo) using Ajax.
The firmware update https://github.com/versamodule/ESP32-OTA-Webserver: uses the ESP IDF HTTP Server component (https://docs.espressif.com/projects/esp ... erver.html) to serve the HTML page which includes javascript. The httpd APIs seem to have better functionality for supporting receiving the file for the firmware update compared to the netconn functions used in the wifi manager.
I think that it would be good to use the HTTP Server component to handle the wifi manager functionality, but I am not sure where to start when it comes to integrating the javascript functionality of the wifi manager web page. I am able to display the page, but due to lack of know-how, I am not sure if those httpd functions can handle Ajax that is used in javascript file that is inlcuded in the wifi manager.
If anyone has an idea of whether or not integrating one way or the other (wifi manager -> firmware upate or vice versa) is a good idea and why, it could at least point me in the right direction.
Thanks
The wifi manager https://github.com/tonyp7/esp32-wifi-manager: uses netconn functions to serve the HTML page and to support GET/POST requests from a javascript file (code.js in the repo) using Ajax.
The firmware update https://github.com/versamodule/ESP32-OTA-Webserver: uses the ESP IDF HTTP Server component (https://docs.espressif.com/projects/esp ... erver.html) to serve the HTML page which includes javascript. The httpd APIs seem to have better functionality for supporting receiving the file for the firmware update compared to the netconn functions used in the wifi manager.
I think that it would be good to use the HTTP Server component to handle the wifi manager functionality, but I am not sure where to start when it comes to integrating the javascript functionality of the wifi manager web page. I am able to display the page, but due to lack of know-how, I am not sure if those httpd functions can handle Ajax that is used in javascript file that is inlcuded in the wifi manager.
If anyone has an idea of whether or not integrating one way or the other (wifi manager -> firmware upate or vice versa) is a good idea and why, it could at least point me in the right direction.
Thanks