Multi-EAR / Multi-EAR-services

Multi-EAR system services and configuration for a deployed Raspberry Pi OS LITE (32-bit).
MIT License
0 stars 0 forks source link

Add websocket for broadcasting InfluxDB to JS clients #3

Closed Jollyfant closed 2 years ago

Jollyfant commented 2 years ago

Shoul add a Python Websocket Server to broadcast data to HTML5 clients for the dashboard

Jollyfant commented 2 years ago

In JavaScript:

<script>
// Create WebSocket connection.
const socket = new WebSocket('ws://localhost:8765');

// Connection opened (sending does nothing)
socket.addEventListener('open', function (event) {
    socket.send('Ping');
});

// Listen for messages
socket.addEventListener('message', function (event) {
  console.log(event.data);
});
</script>
Jollyfant commented 2 years ago

See #4