When most people want to keep tabs on what their 3D printer is up to while they’re out and about, they’ll install OctoPrint on a Pi and be done with it. But what if you’re just on the other side of the room? Inspired by the stack lights used on factory floors, [Jeff Glass] decided to add a similar system to his Prusa Mini so he could see what it’s up to at a glance.
It turns out you can get these lights pretty cheaply online from the usual retailers, and as [Jeff] explains in the video after the break, driving them is about as easy as it gets. Rather than being some kind of addressable device, they generally have a single common 12 or 24 volt DC wire and ground lines for each color. With a USB controlled relay board, kicking on the appropriate light is simple from your operating system of choice.
What ended up being a bit harder was finding out what the Prusa Mini was up to. The printer offers up a simple status web page, but it has a few oddball quirks that make it difficult to scrape; such as presenting a little pop-up message that you have to manually close each time you load the page. But after spending some time with the powerful Selenium library for Python, he was able to create a script that worked its way through the UI and pulled the relevant status messages. Obviously the resulting code is Prusa specific, but the general concept would work on other printers assuming you can find a reliable way to pull the device’s current status.
After coming up with a wall mounted enclosure for the electronics that doubles as a mount for the light itself, [Jeff] can now see if his printer needs attention from clear across the room. An especially nice feature when the printer is all buttoned up inside of its enclosure.
Eh, that’s one thing we at Smoothie definitely have made a bit more convenient than is usual with the older 8-bit systems: http://smoothieware.org/network#api
It’s an ARM based STM32. Although no idea if Marlin 2 or Prusa’s UI support some form of API after a bit of reading.
If they have some kind of web interface, they most likely do/have to. Do they? You could just get a few bucks and add an ESP3D setup to any controller too, there are options around. Smoothie does make it more convenient though :)
So the API is currently very limited, hence the goofy workaround here. You basically get one (two?) endpoint, and it’s got the information for powering the web UI encapsulated in a single request. There are stubs and TODOs to add a more fully featured API, though, so I’m hopeful. I’ve put in a small UI pull request for a feature on the LCD, maybe this is a good future project to hack on.
I mean, if they let you send Gcodes and get answers back, you have 99% of what you need, no?
As an industrial sparkie, would like to point out a few things about stacklights. ( or tower lights as we call them here)
They are modular so you can put the colours in any order and run then base up as well as down. the light modules are avail in white and blus as well as red,amber.green..
Sound modules are availablre as well if you want a sound warning. Just put them in the stack with the light modules. Yes they are available in LED as well as filament globes.
Creator here – just chiming in to contribute to what everyone is thinking: “Why not just put a window in the enclosure?”
The boring answer is I was concerned about the (old, brittle) plastic rollers and guides in that enclosure, and didn’t want to compromise the structural integrity of the door.
Was this the easiest/fastest/cheapest/best way to solve the problem after that? Probably not. Lots of fun though.
No spare GPIO pins on the prusa hardware that you can trigger with gcode?
There are a couple, particularly on the expansion header (PB0 and PE5). Both in theory are addressable via an M42 command, but I don’t quite grok how the Prusa firmware was naming those pins/pin mappings internally, to be honest. That would be a neat thing to chase down, though.
Even if there was, why connect to the printer if you don’t need to? This solution could be placed anywhere on the same network.
Another solution: https://www.prusaprinters.org/prints/50322-prusapager-mini-mini
Very nice :) But there’s an easier solution for the scraping part. You can get all the data as JSON: http://IP/api/telemetry
Yeah it’s ultimately pretty silly huh? The only thing that’s not in the telemetry is the “Printing” vs “Idle” determination, which is just whether the print gcode title is empty or not… I’m using the API to get the Z-height to determine whether the printer is truly printing or paused already as well.
I had the same issue, as you say the API is very limited and does not send a printer status. Like yourself, I used the absence of a `project_name` to determine if it’s idle.
simple install glass door for enclosure ;-)
or better this and camera recognise error/fail inside too
Mount holes are upside down
Hey guys I find the idea really amazing but want to put out gpio commands for WS281b LEDs. I am still not that smart regarding programming. Does anyone of you has an advice of how I can implement this idea of reading the UI with putting out commands to the GPIOs of the raspberry?