Skip to content

Conversation

@dvader
Copy link

@dvader dvader commented May 6, 2020

Adding project "ESP32/ESP8266: Control Outputs with Web Server and a Physical Button Simultaneously" with Server-side event (SSE) instead of polling for server feedback.

Alexis Denis added 2 commits May 5, 2020 21:48
…Physical Button Simultaneously" with Server-side event (SSE) instead of polling for server feedback.
@dvader
Copy link
Author

dvader commented May 10, 2020

Adding project with WebSocket. The old project used polling for server to client communication and XHR for client to server communication. It also used templated HTML code. The entire communication (both ways) is now handled via WebSockets. Updates are "instantaneous" and multiple clients can be connected at the same time and their status updated in real-time.

Limitation:

  • no auto-reconnect. On mobile platform, the browser will disconnect after a while and when going back to the page, the connection is closed. The only way to re-connect is by refreshing the page.

  • Also, the server only handles single packets (it ignores multi-packet messages) and only text packets (no binary packets).

  • The "protocol" is extremely simple but nothing prevents a more elaborate protocol using JSON or others. This is sufficient for proof of concept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant