jnsbyr / esp8266-intexsbh20

MQTT WiFi remote control for the Intex PureSpa SB-H20 and SJB-HS whirlpools
Other
64 stars 20 forks source link

Wifi Web Server #52

Open titolini72 opened 3 weeks ago

titolini72 commented 3 weeks ago

Hi all and mainly author I spend time to grab Wifi WebServer from Joff. I've tested on my side and it works well indeed. However I don't know how to pull this feature toward your repo.

May someone can help me ? Regards

jnsbyr commented 3 weeks ago

This is a duplicate of #22.

If someone provides a well tested merge request, I will evaluate it. Please make sure that the code you integrate is compatible with the current project license, that the websever is added as feature that can be turned on and off using a define and that the existing project structure remains more or less unchanged.

titolini72 commented 3 weeks ago

Hi, Thanks for your quick answer. The WebServer I added has a genuine impact on the code since it replaces the need to upload a config.json (LittleFS) to make it work without an external tool. I will rethink the code to see the feasibility of putting it under feature flag. Regards

titolini72 commented 3 weeks ago

Jens, After reading #22, just to be clear, the feature aims to avoid the need for a programming tool by enabling Wi-Fi in Access Point Mode to issue SSIDs, MQTT Infos, and so on. This avoid also to re-program ESP whether any change in its env : like new pass phrase, new port, new user. User doesn't need to disassemble the SPA for that. Hope this is more clear.

jnsbyr commented 2 weeks ago

From my point of view a web server is responsible for handling HTTP and/or HTTPS requests, like Apache or Nginx do. But what most users really talk about is a web UI. And a UI can support various features, like setup, status and control. Typically this also needs some "glue" code to combine the UI features with an existing backend, and that "glue" is often called "middleware".

When enhancing the current project these 3 parts (web server, UI and middleware) should be added as separate elements. Additionally the existing code will probably need a few modifications to provide the required events and controls. This should result in a new project structure where the web UI can enabled and disabled with a compiler option.

Form your comments I take it that you will focus on the "setup" feature. Please remember that the ESP8266 platform is EOL. If I would start the project today I would probably use an ESP32-S3. This would also help to avoid problems like #40.

If you already have a working prototype you should be able to verify if the problem from #40 becomes more apparent when the webserver is actively used. The ESP8266 is just not powerful enough to handle time critical operations and extensive WiFi operations at the same time. The results may vary depending on the number and size of the HTTP objects that are transferred (page, CSS, JS, images, etc.).

titolini72 commented 2 weeks ago

I agree with your project analysis: this can be handled in 3 chunks. What I did was a setup part. As Setup is in AP mode and the rest is in STA mode, the code overlap is reduced and I don't believe this will have real-time performances.

As for ESP32-S3, I am sorry I didn't test as I used an old WeMOS-D1 (ESP-12F). I'm pretty sure the code I used for Setup is ready to handle HTTP(S) requests. This is just a matter of time :)

Nonetheless I keep in mind the other parts. I think for a basic status UI is not that complicate to put in place. I would handle that in other project. I can check on ESP32-R3 at that time if you think both control and HTTP request may have an impact on real time.

My project (SETUP) is ready for submission if you don't mind. Best Regards

jnsbyr commented 1 week ago

Just to be clear, at this time this project has no support for the ESP32 MCU. This would need code migration and testing. As far as I know there are forks of this project that already did this.

From your recent explanation I take it that you originally did not plan any live webserver operations but instead use AP mode for setup. We should keep it limited to that scope and see how it works out. This project has a development branch. You should update develop from main, if necessary, and then create a merge request for you changes.

titolini72 commented 1 day ago

Jen, I don't know whether this is me or Read only GitHub but I can't push my change upon you repo. remote: Permission to jnsbyr/esp8266-intexsbh20.git denied to titolini72. I take this opportunity to tell you that this code works on ESP32-S3 as well. It hasn't been fully tested yet, though, but it boots. Regards