Subscribe to MQTT, extract JSON from a message and make lights blink on an SVG page.
npm install socket.io
- Make sure your MQTT server is running and listening on localhost.
./run.shwhich starts the Node socket server
- Point your Web browser at your Web server, to
.../corp.html. You should see the connection in the terminal window running node.
- Start publishing something on MQTT, as per the example in
socket.ioexample for Node (
pusher.js) and some bits of
corp.htmlare by Robert Hekkers