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.
- Launch
./run.sh
which 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
randpub.py
- The
socket.io
example for Node (pusher.js
) and some bits ofcorp.html
are by Robert Hekkers