Tag: Server-Sent Events with ESP32 and DHT11

1 articles found.

Server-Sent Events with ESP32 and DHT11

Server-Sent Events with ESP32 and DHT11, What is Server-Sent Events, SSE in ESP32, How does the Server-Sent Event works, Event-Source connection esp32, handling http get request in esp32

Hello readers, I hope you all are doing great. In this tutorial, we will learn how to update a webpage using Server-Sent Events and the ESP32 web server. It is a server push technology that enables the client devices to receive automatic updates from a server over HTTP (Hypertext Transfer Protocol) connection. SSE also describes how the server can initiate data transmission towards the client once an initial connection with the client has been established. We have already posted a tutorial on how to implement Web socket protocol with ESP32 which is also a protocol used to notify events to a web client. Both the Server-Sent Events (SSE) and Web-Socket technologies seem to be quite similar but they are not. The major difference between the two is that SSE is unidirectional, where the web client can only receive the updates from the ESP32 but it can’t send updates back to ESP32. On the other hand, the Web-socket protocol is bi-directional where both the web client and ESP32 can send and receive updates/events. Fig. 1 Server-Sent event The Server-Sent Event process initiates with an HTTP request from the web client or web page to the ESP32 web server. After that, the ESP32 is ready to send updates or events to the web client as they happen. But the web client can’t send any response or data to the ESP32 server after the initial handshake takes place. Server-sent event technology can be used to communicate an event, GPIO states or to send sensor readings to the web client, ...