We explore controlling your printer via a Raspberry Pi running the open source OctoPi Linux Distribution - My favourite part of this little project is that we can do it for the fraction of the cost of a full-fledged PC
Hey guys Aidan here from Core Electronics and today we're going to be looking at setting up octopi and the Octoprint print server for a Lulzbot Mini 3d printer now if you've seen a lot of what we knew before you'll know that it can only print using a USB tether there's no SD card printing available on the Lulzbot Mini so what we're going to do is set up OctoPi which is a Linux distribution that runs OctoPrint print server and that is going to be able to manage (over a network connection) all of our printing needs from the Lulzbot Mini, so to do this you need to pick up a few things one of those things is a Raspberry Pi 3 model B you also need an SD card that's 8 gigabytes or larger and power supply and the keyboard and mouse so we can enter some data into our Raspberry Pi before we get it all set up and you'll also need a way to view what's happening on your Raspberry Pi so that would just be a HDMI cable and a monitor so let's get started by working on our SD card we're going to install the operating system directly to it.
So we'll go ahead and insert our SD card into our SD card reader on the laptop once we get that in we're going to quickly format it so that's as simple as right-clicking on it selecting format once we are in here we can select start and we just want to quickly format a fat32 file system is fine. So once that format is complete we're going to go ahead and open up our SD card image writer where you can Win32DiskImager to disk image it's a nice and easy piece of software you can grab for free, just do a quick google search and download it. Now all we need to do is make sure that we've got our SD card selected in this drop-down box and then we'll just find where we put our OctoPi setup so you can download octopi directly from the octopi website just google octopi and it's the first the first response that you get go straight into it and in the middle of the page you'll see a download button so once you've got that downloaded, I think the download is about 1.6-1.7 gigabytes, grab that and you can do the exactly what I'm doing. Go ahead and write that one to your card, yes you are sure that that's what you want to do, and it's pretty much as simple as that to get that operating system written to that SD card.
Alright guys so that's how quickly that one went through, the write has been successful now there's an additional step. So our SD card has just had the operating system of OctoPi written to it now then there's one more step it can go through and this is just a bit of a judgement call from you if you're going to be using an Ethernet connection to connect your Raspberry Pi up to the network you can just skip this section entirely if you wanted to connect it up to the wireless network which isn't the best if you are wanting to stream using a camera later on which you can connect the USB webcam or a Raspberry Pi camera to that, anyways if you're going to be using it for streaming, Wi-Fi is not the best solution but either way if you want to use Wi-Fi you need to go into the root directory of your SD card now and you want to be opening up the OctoPinetwork.txt document which is this one here once you've got that one open you can scroll here and this is not the best text editor to be using or open up with notepad plus plus there we go and essentially you're just going to be doing the Wi-Fi configuration just like it says here, so three segments will cover in most cases just uncomment the lines prefix with a single pound sign and that's all you need to do so go ahead and if you were using a normal Network today you're probably using WPA / WPA2 to go ahead and delete these pound signs and put your SSID in here so Network name and your secret so your password in here in between the quotation marks once you've got that done you can just go ahead and save that file and that will allow you to login directly to your internet connection when you first boot up your Pi.
So once that's done we can go ahead and remove our SD card from a computer and we now got a working version of OctoPi that we can boot up our Raspberry Pi using. Now all I need to do is insert my newly formatted SD card into my Raspberry Pi which just goes face down towards the board make sure it's inserted correctly once I've got that done I can connect up my HDMI cable just like that I can also connect up my power supply which is essentially that one I've already got one here ready to go and I'll also go ahead and connect up on keyboard and mouse just so I have some way to input some data into my Raspbery Pi for now.
Now the main point of plugging this in now is for a quick and easy way of getting our IP address, that we will have been assigned to this PC to this RPi so we'll go ahead and connect him by ethernet once you've connected up we'll go ahead straight back over to, alright so now we've got our Raspberry Pi booth at up everything went through just as we expected it to. What we're going to do is just log into our Raspberry Pi and the default username and password is just PI and raspberry is the password. Awesome. so the first thing we want to do is run a Raspi Congi, to do that we can just run a sudo raspi-config
command and press ENTER and that's going to load us straight up into this now the first thing you can do and the first thing I like to do is to change my user password just give me a bit more security we then can go into our enable camera setting, this will enable your Raspberry Pi to use a camera connected the CSI connector on board which is perfect if you're wanting to stream photos or videos or make time lapses of your print using a camera camera board. So go in there and you can enable that off the bat. Once you've done that once off to print servers running if there's a camera connected it's going to be streaming that data to it, just very easy to do. Another thing you can do is go to your Advanced Options and you can actually change the host name of your PI now if you were running multiple Raspberry PI's on a single network this would be the place that you'd go to change the name of the Raspberry Pi, so as a default it's just called OctoPi, which means that when you're searching for that if you're using a Mac or Linux computer you'd be looking at octopi.local as the address you're typing into URL bar, I can change this here now if I'd like to and I can call it something like lulzbot-mini and that just gives me the knowledge that this the hostname of this device is now the lulzbot mini. So in addition to that one setting we can also go into the Advanced Options and you've got a couple of other other things that you can do, so you can enable SSH which is always good especially if you're looking to one day be able to just access it remotely to do any of these things that we're doing today you'll be able to do that by SSH. Another thing is updating your Raspberry Pi image, so if you click update here it will go through and download all the packages that you need to update to the most recent revision. So there are the quick and easy things you can do before you do anything once we finished that one you'll have to reboot your Pi, we'll go ahead and do that.
Alrighty so the Pi is booting back up now and the main thing that we're looking for is an IP address so we want to know our local IP address on the network and that is for Windows users the way that you're going to login to your OctoPi setup so again we're going to have to log in notice now that the host name has changed to lulzbot mini login not the OctoPi login I didn't change my password or my username so I can use the same one as before which is PI and raspberry and then we go we logged in now to get my IP address I'm just going to do a simple ifconfig command it's a really simple way to find out and I'm going to be looking for eth0 and if I look on the second line there you can see the second line of eth0 it says I net address 10.0.0.75. I'm just going to remember that 75 is the number that I'm looking for, with all that said and done we can go ahead and connect our Raspberry Pi up to our 3d printer now and we should be able to log in via the network connection from the laptop.
Right just to make sure we have to connect our 3d printer up to our OctoPi, otherwise it is definitely not going to work so we'll go ahead and just connect it via USB just like that, just like that I'm going to quickly reboot my PI, just like that. I'm also going to make sure my printers turned on so now jumping back over to our desktop, we should, should be able to log in to our Raspberry Pi using that IP address that I mentioned before which was 10.0.0.75, go ahead and do that.
Okay so now I'm back on my laptop and I've just logged in to my Octoprint server using the IP address that we just got off our Raspberry Pi which was 10.0.0.75 now there's a couple other ways if you guys are network wizards out there you guys will know there's a couple other ways to find that IP address, I just think that's a really simple and straightforward way for someone to find it. So now we're just up to some basic configuration options for our OctoPi setup so I'm just going to give this one a user name of core and password cool and we'll give access control enabled now essentially that means that while I can access the OctoPrint server I can't actually start or control any of the movements of the printer unless I log into it which is pretty, a pretty smart option when it comes to that sort of thing, so I'm just going to go ahead and login and show you guys the basics of OctoPrint so I'm now logged in as that user and there's the update available there so if you guys are setting this one up at home you definitely going to want to go ahead and update your server now. I'm just going to ignore that for now. So at the top of the screen you've got a few options you've got set settings and system and in the system settings you can restart, reboot it or shut it down completely now in the settings options you've also got a bunch of different things in there. For the connection this is talking about the connection to the printer itself you can set everything as automatic and it will just automatically detect so you can auto connect that printer and you can save the connection settings we won't do that just yet we've also got the state of the printer, so currently because we're not connected to a printer you can obviously see that that state is offline and if there was something printing it would tell you what file was printing if there was a time that's happening of it the total print time approximately of it and all the other settings that you see that and you've also got the print pause and cancel options there down below that you've got your file menu now here we can just directly upload g-code files from our computer to our OctoPi setup just like I've done there so I've just uploaded a really simple Rocktopus g-code file straight to my Pi. Now in the center of the screen here you've got this little section this is just a temperature graph of what's happening on your printer because they've got the options here of entering your data yourself so the first thing we're going to do is just make a printer profile for our current printer so I'm going to edit the default file that's fine, the origin is the lower left, and now we're just going to change the volume to our printer now bear in mind that none of these settings actually matter unless you are planning on slicing on your pie and that means you're uploading an STL and you're expecting your Pi to do all the slicing for you in G-code but I like to just go through the setup of this so go ahead and you can change that to all the relevant values you know the volume on that Mini, actually just like that or whatever. You can confirm those and now you've got that set as your default printer, we can go ahead and save the connection settings and auto connect with our printer, you heard the printer kick up its obviously talking to something there and we can quickly and easily see that this is about to connect, so it's just detecting the baud rate at the moment.
Alright guys so we can see that the printer is now connected and operational and it's just as simple as you would expect so I've got my octopus files here, I can select to load that one into the printer I can select to just directly load and print it if I do that the printer is going to kick off straight from these slice settings from Cura, which is where I slice that file on the right here like I said before you can see this temperature graph or I can set by entering values in here I can set different temperatures and get a sort of a live accurate representation of what's going on in my printer. Now if I go into my control menu I can also set things like home my printer and this is just sending those g-code commands directly to the printer to home the different axes there's also a few other things that you can do in here by extruding or retracting and general things like fans on motors off all those sort of things in the g-code viewer, it's a bit better when you're actually printing something but you would actually see a live representation of what the tool head is doing on the print bed right here, it's quite cool, and the last two more of sort of pro user things this enables you to see what g-code commands are being sent between the printer and your OctoPrint server and you can also enter your own G-code commands into that terminal line and finally the time lapse configuration option just gives you the ability to turn time the time lapse mode on and you can do that you would have a printer connected and essentially the octo print server is going to take a snapshot or whatever the printers connected to on a certain thing, so for the time lapse mode we can see there there's a timed one or Z change so you can have it take a picture on every layer and get really nice visual representation of the 3d print but you know it could be a 25-hour print in a 15 second time lapse or something so it's all quite cool. Now that's just the basic the basic setup for an Octoprint server right now I'm fine to just start printing using my OctoPrint server so that's that's it that's a pretty simple process if you ask me thanks for watching guys I hope you have a good day.