mariolukas / Watterott-CO2-Ampel-Plus-Firmware

Firmware for Watterott CO2 Ampel (Plus Version)
GNU General Public License v3.0
15 stars 13 forks source link

How to display data and update without refreshing web page #32

Closed philippesikora closed 2 years ago

philippesikora commented 3 years ago

Hello,

Thank you for your great job. I would like to re-design the web server to display and update data without refreshing web page. https://github.com/khoih-prog/WiFiWebServer

This WiFiWebServer library compatible with ATSAMD21 using WiFi101 module is compatible to ESP32 WebServer and ESP8266WebServer libraries to port sketches from ESP8266 and ESP32.

WiFiWebServer library currently supports many boards, can you help to support CO2-Ampel (SAMD21) board ?

Compilation with the library is working fine but web server does not work, I guess we need to update board.txt or platform.txt files.

Thank you for your comments and support

mariolukas commented 2 years ago

There are multiple options to do that. One would be to use Server Sent Events (SSE). https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events

mariolukas commented 2 years ago

Solved within v.3.0.0. The new version comes with a new WebServer and the Interfaces updates the state by JavaScript HTTP Background Requests now.