Octoprint and node-red dashboard

Here's my node-red integration via the mqtt plugin. The LED ON/OFF uses the api POST via /api/system/commands/custom to turn a 2 channel relay module (one for printer, other for led).

For the cam, I have a static image in place. A switch will open the stream for 15 sec and then return to the static image, otherwise the dashboard would leave it streaming continuously. The octoprint web does a good job of disconnecting the stream, when not in use.

I'm not printing Marvin right now, but I set some payloads for this image.

Cheers!

3 Likes

Where does this run? (phone, workstation, on the Pi itself)

Node-RED usually runs on a Pi or BBB or some other SBC, but you can run it on almost anything that can run node.js, AFAIK. You could most likely manage to run Node-RED and mosquito (MQTT broker) on the same Pi as OctoPrint, as long as you're not going ape with it, since there's usually plenty of RAM available, and you shouldn't need too much CPU (again, so long as it's lightly loaded...if you're going to go nuts with it, put it on a separate SBC).

I'm trying trying to conceptualize if this is a client-server sort of thing and that the client is remote. I'm guessing so.

I've worked with Node-RED so it's somewhat interesting to me. It's a bit like ladder programming.

Hello @octoMqtt I am trying to do the same as your work, integrating OctoPrint with MQTT and Node-Red. May I ask how you created your dashboard? I'm new to this. Can you share your exported flows? I was able to subscribe to all topics and I tried to make a dashboard but it's not working. I also don't know how to display the camera stream. Big help if ever you respond!