Hey all, I’m new to MakeICT (and I haven’t taken intro to 3d printing yet), but I recently had an idea for the FabLab. It looks like ultimaker printers have a web api built into them, meaning that one could query the printer for various information about what’s going on with the printer. (They don’t post the specification of this api publicly, but the openapi spec should be available on the ip address of the printer itself) I was thinking about developing an application that could show the progress or ETA of prints for each printer in the lab, while also potentially showing a preview of the stl file currently being printed? Maybe also attach a camera to the printers to provide a live view of prints?
We actually used to have a cameras on them, which you could see from the webpage. So if you were in another part of the building, you could still check up on your print. It clearly didn’t help you unless you were at the space. Currently you can’t access our network without VPN access, and all of our public facing access is hosted offsite.
Yeah, this has been on the to-do list for a while. All of our printers are actually run through Octoprint, which is open source and has a documented API and a plugin system. So no need to deal with any undocumented proprietary systems. As Steve mentioned one minor hurdle would be getting the information from the internal network to an externally accessible server. There are multiple ways this could be accomplished: set up a VPN with the server, push data from Octoprint to the server, etc.
Having an externally accessible webpage with an overview of what the printers are currently up to would be very handy. The STL file wouldn’t be available, but there is an image that is integrated into the gcode file that should be accessible.
I look around every once in a while for pre-built solutions that fit the bill, but most external access setups are aimed at giving you full access to the printer and require login credentials, both of which are not desirable for our use case. If you want to try and tackle this I can definitely help get you started and pointed in the right direction.
If we do it right, it might also be a useful way of tackling the requested reservation system. If the status page showed how long is remaining, and maybe have a wait queue where someone could add their name for “next access”. If we wanted to put enough effort into it, it could even add notifications in to let the owner and the waiting user know that the print is finished.
Maybe we could try an agent that lives within the network that pushes to an API listening outside the network like on the cloud or something? That way we don’t have to worry about opening ports or dealing with VPN’s. However we’d have to worry about security on the API side, but fortunately that’s in the application domain and not the networking domain which means that we can work something out.
I guess a good starting point would be to ask what features we want from our public facing application. It sounds like we’re just wanting a view into what the printers are doing without necessarily requiring a login or providing external control? Is scheduling a part of it? Notifications when your print is done?
@Christian@brsmith7 and I talked about the Octoprint API a couple weeks ago. I tried to make a quick connection and it seemed like I needed authentication that I didn’t have. (Authentication would be a good thing.) Maybe I just didn’t know what I was doing.
In that conversation we thought posting the status of the printers would a good start and good learning base before moving on to a reservation system as mentioned by @SteveO.
I was going to try my hand at the API as an opportunity to learn more about Python but if someone else wants to take a shot at it - please do.
Is there a public directory on the Wiki where a file could be dropped? I’m assuming if we can drop a file there something could be created in the Wiki to display that data, would that be true?
Yeah, a great start would just be displaying printer status on an externally accessible webpage. Reservations are a whole different beast that would be further down the road.
Yes, you need an API key. We can make a user with read-only permissions and generate an API key for testing.
MediaWiki has an API but I’ve never looked into it. It might be easier to just link to an external page.
I’ll be in the Fab Lab tonight 6:30-8:30 if anyone is around and wants to chat.
Given a service account is set up on a printer it should be fairly easy to query the printer on it’s current status using an http client. Then it’s just a matter of figuring out where we want to put that data
@chris_w I’m going to be busy most of the weekend. If you and @ThatNerdUKnow want to give it a go you’ll need an API key. @Christian created one the other night but I’m not sure how to get it to either of you securely and in time for the weekend.
Yeah, each printer has a Pi connected via USB that is running Octoprint.
@xrunner you can just send them the API key in a PM or email. It’s got read-only permissions, so even if someone gets it they can’t really do anything interesting. And we’ll probably change it when the system goes live anyways.
@ThatNerdUKnow@xrunner
I’m a bit busy this weekend, but will be at make ICT Tuesday and could work on it then (about 5-7pm). If either of you are available then, let me know.