EASILY Add An IP Camera to Your 3D Printer - WORKS WITH ANY FIRMWARE!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today I'm going to show you how to add an IP camera to your 3D printers using one of these 7.50 esp32 cameras this method will be able to work with Marlin Clipper reprap or any other type of firmware that you have running for your printer because it's not relying on the printer's firmware in order to view the camera however I am going to show you how to set this up in Mainsail if you are using Clipper so let's take a look at what we have going on here we have an esp32 camera and these have built-in Wi-Fi which makes adding it to your Wi-Fi network super easy this also comes with a built-in serial to USB board right here which makes it super easy to code and it means you no longer have to use one of these ftdi chips like you would for an older esp32 cam or if you didn't have this board with it already I got a pack of four of these from Amazon which cost me 30 in total because I have multiple printers there's going to be a link in the description below where you can get yours as well this is currently how I have it set up in my cr5 Pro H and we're going to get to how you get there real soon so now we're going to jump into the coding aspect of this so all you're going to need is a mini USB to USB a cable if you have this type type of connection on your board you're also going to need a free USB port on your computer and Arduino IDE but let's jump onto the PC for this so what you're going to want to do is head over to arduino.cc go down to Software and to downloads if you have Windows 10 or newer and a 64-bit system you can use this link here or select the appropriate link for the software that you're going to use for this project Windows 10 and windows 11 both have the ability to automatically install the driver for your esp32 cam once you've downloaded Arduino IDE you can go ahead and install everything by accepting all the defaults and then once you open it up you're going to get something just like this it might not have a board selected but that's okay we'll get to that in just a second but before we get here there's a couple things we need to do first so before we jump into the coding aspect of everything we're going to head over to this installing documentation provided by the manufacturer which there will be a link in the description below for this so what we're going to do is we're going to go to this link here the stable release link and what this is is basically a package of everything that you're going to need for all the code in your Arduino environment so once we have that link copied what we're going to do is head back into Arduino IDE so what we're going to do is head over to file preferences and then additional boards manager URL which will be here that's where you're going to copy that or that's where you're going to paste that link that you just copied and then we're going to hit OK and after you've done that at this point you can go ahead and plug in your camera via USB to your computer so we're going to do next is we're going to go to tools go to board board manager and then right in here it's going to pop up your board manager we're going to search for esp32 here we go esp32 by expressive systems I already have mine installed but if you don't have yours installed you can go ahead and click install there will be a bunch of versions it's always recommended to use the latest one there now once you have this installed what we're going to need to do is find out what port your camera is on so to do that we can hit the start button here and then just type in devmgmt.msc or device manager it'll come right up that works with Windows 11 as well and then we're going to go over to Ports and com we're going to go down here and when we see ch340 that lets us know that that's where our camera is on so that's the USB port com3 and once you find that we're going to go over to here to where it has whatever board you had last if you had one or if you had nothing then we're just going to select unknown com3 what board this is is going to be the AI thinker esp32 cam we're going to make sure that that is selected for the whatever Port it was on your machine and then we're going to hit OK so now once we have this board selected what we're going to do is go over to file examples and then there's going to be examples for AI thinker esp32cam it's cool because there's a lot of a lot of different ones in here if you want to play around but for the purposes of this video we're just going to hit esp32 we're going to go to camera and camera web server what that will do is it's going to open up a sketch that was already created for this camera by the manufacturer we have some different tabs up here and what we're going to do is we're going to go through some of these make some changes where we need to for this specific model boom and then we're going to make sure that it's working right before we install it in our printer but first let's go over to this camera web server.ino what we're going to do here is this is where you set your definition for what camera model you have and we do not have this one here the espi we have the AI thinker one so we need to comment this out by putting two forward slashes then we're going to go down here where the AI thinker is and we're going to uncomment that now that lets the program know that we are running this camera model and it will use pins and everything else that it needs for this specific camera model next up what we're going to do is we're going to set our SSID and our password so put this whatever it is for your network let's just say for example my network is foul news and my password is I 8 too much cheese last week for 20 69. the most secure password Network you'll ever find so go ahead and make those adjustments for whatever your SSID and your password is that way it can easily connect to your Wi-Fi when we're ready to do so something worth mentioning when you have your SSID and password input you're going to want to make sure that your SSID name matches exactly as your network name so for instance if I used a lowercase f here instead of a capital it will not connect also you're going to need the quotes here and the quotes here either you SSID or password contains a double quotation like this it will only take up to what's between the first two quotation marks so what you can do is you can add a backslash before the quotation mark and the backslash will be ignored but it will pass the double quote through to your password or your SSID if you're a complicated person like that so moving on to things that are specific to this exact camera that I've got here and also specific to Clipper and Mainsail which this part isn't necessary if you're not going to be using this with Mainsail but if you are you're going to need to make some changes right here so first we're going to take the config.frame size line here and we're going to change around a couple things the frame size is currently uxga but we need to change that to SVGA because for some reason uxga will not work with Mainsail so once that's changed we also have a couple other little things to change and we're going to scroll down right to where it says config.pixel format equals pix or pix format.jpg we're going to leave that alone but the one right below it the set frame size we're going to make sure that again that is SVGA and that's all we need to change in the camera web server.ino so next we're going to go over to camerapins.h because for some reason this particular camera is um not set up the same exact way as the example here but we're going to change it just a just a few things here to make sure that it's going to work the way we need it to work so once we're over in this tab here we're going to scroll down until we find our camera model which is the AI thinker here so by default the LED number here is actually Four it should not be set to 33 it won't work with 33 on it don't know why it's there like that but the actual LED 4 flash on here is four so we'll change that over to four now and then once you've changed that we're going to go back over to camera web server.ino just double checking everything that it looks okay and everything looks okay to me so all the boards plugged in it's always a good idea to verify that the code is right and we'll compile the sketch which takes about a minute or two and it looks like the sketch is valid so what we're going to do now is we're going to upload the sketch by clicking the upload button here which will install the sketch on your camera it'll do the same thing it'll start compiling the sketch and then just give it some time this can take anywhere from a minute and a half to three to four minutes depending on the speed of your computer USB connection quality Etc so just let it do its thing once it's all set up what we're going to do is we're going to take a look at the serial monitor because we have to find out what IP this thing just connected to so to do that we're going to go over to the top right here where it says serial monitor I'm going to click on that if you don't see anything happening in the serial monitor yet we're going to hit that reset button on this board here and then come back over to serial Monitor and you'll get some messages here one thing to note is if you get just a bunch of garbled text that just looks like these symbols make sure that your baud rate matches the baud rate of the camera which is in this case 115 200 bog so you'll get a message here you may have to scroll down at the bottom here and it will say Wi-Fi connected camera ready use and will give you a local IP address to use for this so to verify that this is working we're going to grab this IP address here in between the single quotations we're going to control C copy it and we're going to go over to our browser and pop it in there and then hit enter and if all is working well you'll be brought to this page here which is the camera's IP address and we're going to go ahead and hit start stream which hey there's the computer there so one thing to note is it might be a little bit laggy especially your first go around these things don't really like to be powered via just a standard data USB port they work a lot better with either a USB charger or if you have 5 volts going directly into the 5 volt pin itself they're a lot more stable and we're going to see how that looks soon so what we can do from here to test that our LED is working we're going to put this led slider all the way up and that makes sure that that number four pin you defined is the correct pin and in this case it is you can probably see it kicking on and off here which isn't the best um isn't the best looking right now but believe me it does get better so from here we're going to stop the stream and we could go ahead and leave all of these settings as they are you can play with all of this as you'd like and just kind of get it good to where it looks good for yourself and since we have it defaulted to this resolution if you're going to be using Mainsail I suggest that you leave it on this resolution because that's what works with Mainsail with this camera maybe others might work but this is the only one that I found that will work without any issues and at this point if you have Marlin you're just going to go to your IP address here and this is how you're going to be able to monitor your prints from now on however if you have Mainsail what you need to do is go over into Mainsail and you can see my cr5 Pro's camera right there the one that is already existing is all set up here but if you're adding webcam for the first time what you're going to need to do is go over to the settings button over here scroll down to webcams and then we can even add a webcam just because I don't want to delete that one so the URL for this webcam is going to be the IP address that you have for yours which we can grab right from here and then we're going to go back over to here and then interestingly enough this is something you have to do as well you're going to have to hit the colon here do a port 81 forward slash stream I'm not sure why but that's what Mainsail wants we'll just name this one ender3 because that's probably where this camera will end up going you can have it Target frames per second you can have it not do that but we're just going to put it over here to MPEG streamer that seems to be the most stable and as you'll see that there's nothing coming up here just yet and that's okay so we're going to hit save webcam and if you go over to wherever your webcam is this can take sometimes up to three to five minutes to load you might just get a white screen at first that happens uh almost all the time when I first turn on my um my cr5's camera and since again this is running off USB port which it really doesn't like we're going to get some bad frames per second but that's not that big of an issue just yet so we can also select which camera we want here the esp32 I just never renamed it I got lazy that's what's on my cr5 Pro right now it's dark in that room so you really won't be able to see anything that's going on in there I don't have the case light on anyway we can also select the one that we just added which will be whichever one you have there and like I said this screen might be white let's give it a few minutes it's a little finicky and we're going to see we've got some poor frames per second I'm telling you now it does get better if you have a stronger network if you have two things a stronger network connection and you have a stable power source the stable power source is going to be the biggest factor in quality don't ask me why but they're very finicky running off a USB power so you can now choose if you're going to be using this camera through Mainsail or if you're going to be using this camera just directly through the web page here if you've got Marlin you can do that in whichever way you like so one thing I like to do that's not required but it does make things a whole lot easier is assign this a static IP address from your router and now this will always have this IP address and I don't have to worry about chasing it around and adding it to Mainsail or trying to find it over here again and once that's done we're going to get to the wiring of it and we're going to get to the installation one quick thing to note is if you're going to be using this in Mainsail you want to make sure that the start stream is or you want to make sure that the stream is stopped on this webpage otherwise it will not load in Mainsail but if you just want to view it in this you can hit start stream and stop stream whenever you want just so you can see what's going on here and I found this design on thingiverse but it was lacking some things mainly some Cooling and a spot for the LED so let's hop in design spark mechanical and make some of those adjustments real quick and this file will be available on thingiverse I'll have a link in the description below as well as a link to the original creators design and the same goes for this back plate over here as well I wanted to make an area for the DuPont connector to fit through since I wasn't going to be using um the connection style that the original Creator had in mind as well as opening up a hole back here for ventilation because this camera does get quite hot and also I decided to make a bracket that just bolts right up to the cr5 pro make life was a little bit easier all right test fit is looking good the bolt holes line up and it goes up and in there but we're about seven and a quarter millimeters a bit too long here so instead of just buying shorter bolts I will throw some seven and a quarter millimeter spacers in there and if you're wondering it absolutely does clear the print head with plenty of space yeah so now I'm just taking a cheap Buck converter and testing it out 24 volts and turning down the potentiometer until it gets to about 5 volts and that's what we're going to use as our output for our esp32 cam so my case is printed didn't come out great uh probably because I'm using too big of a nozzle for these fine little detailed parts and I printed them all at once so that's usually never a great idea but anyway we're not looking we're not here to look pretty we're here to get a job done so I'm going to assemble this all together make a wiring harness to go from the printer power supply into this Buck converter that just tuned for 5 volts and then ultimately to the esp32 cam with some nice Dupont connectors so I know my printer is not a normal setup considering I've got the SKR mini E3 and a whole bunch of spaghetti maybe one day I'll clean up and an orange Pie as well but I found that this is probably a good spot to mount this Buck converter it's not touching the frame which we don't want it touching any metal because it can short and that's never a good idea so I'll have it powered from this power supply coming out run wires up through here going all the way to the top into there and that's where the camera is going to live so before buttoning everything up it's a good idea always to test your work I ended up soldering this wire here and that goes to the voltage positive and then the voltage negative on the power supply I made sure that the buck converter was dialed down to 5 volts on the output which it is and I threw a little heat sink on the mosfet here just for a little bit of better heat dissipation because these things can get a little bit warm and then I've got this wire which I will zip tie up once I have my camera in place and I have the camera on and it is working I know it's a crappy video recording of a computer screen but let's go ahead and turn on the LED there's a little bit of a delay but nothing crazy but we can see it's working get a nice lovely view of the floor here and we'll turn the LED off and it's off so at this point I think everything is ready to be buttoned up and then put back together this instead of using the corner up here which I originally designed this for but this will work pretty much in any corner I I ended up going with this one just because of this conduit here was a lot more free there's a lot more wires running through this one as you can see through here and there was just no space to run any more wires so this was the easier Choice everything is more or less buttoned up in the bottom end of things here zip tied nicely and again maybe eventually I'll take care of this but for now I'm not going to and here's how the camera install came out I used an M4 by 30 millimeter stainless screw with an M4 nylon lock nut and with that a little bit taught I still have enough control to move this camera in slight angles just so I can get the best adjustment point but I think probably about that way is going to be plenty fine and uh yeah overall I like how it looks and let's put everything back together and test it out for real so here is the end result forgot the camera set up this way and like I mentioned before I can change the angle of the dangle here whenever I please but just about there looks perfect for me and I'll be able to monitor most of my prince quality like that the next upgrade would be taking this and being able to use this physical switch and also a relay controlled by Mainsail or the orange pipe whatever you want to call it so I could have this light turn on and off if I'm remote but this led in here is actually so powerful it can illuminate this whole thing no problem so I decided to change up the design a little bit and I put this swivel attachment on instead of having it just fixed that way I could see a little bit better without maybe just having it fixed always in one spot can still rotate up and down which is nice and we can just kind of adjust the viewing angle as we like now eventually I'm going to have it maybe up here or out here a little bit more and forward or something that way I can see the first layer but usually I'm pretty close by the printer when I see the first couple layers just to make sure everything's going good however this is just a great addition for after those first few layers I have completed and then we can start seeing the rest of the build and with this new design change like I said you can still move the camera about and have all different viewing angles I made some kind of mistake here where I put the nut hole a little too close to this rail however it does not interfere with the moving of the X and Y axis which is pretty nice but I will fix this before I put these files public but for now that looks like all we need and as I mentioned before you can see the camera looks a lot more fluid now it really likes having a solid and steady power supply so if you've got five volts constantly going to it instead of like a USB connection it'll spit out like a good 15 to sometimes even 20 frames a second but for just monitoring the print and not actually producing video this camera Works awesome and for 7.50 you really can't go wrong and another cool feature is you can view this on your phone as well Mainsail is awesome like that but also if you're just using the camera's IP address you can view that on your phone just fine as well and that's going to do it for this video so thank you guys so much for watching make sure to like it if you like it hit subscribe because I'm going to have some more cool printer mods coming up in the future and leave a comment if you have a question or if you just want to say something that I did wrong which I probably did so that's going to do it for now so remember as always keep it foul
Info
Channel: Foul News
Views: 13,754
Rating: undefined out of 5
Keywords: CR-5, cr5, creality, cr-5 pro, cr-5 pro h, cr5 pro h, ct380, esp32, esp32 camera, setup esp32 camera, add camera to 3d printer, 3d printer camera, 3d printer cam, esp32 3d printer, 3d printing camera, printer camera, marlin camera, add camera to marlin, klipper camera install, mainsail camera install, how to add camera to mainsail, reprap camera install
Id: -Z47-tel_8A
Channel Id: undefined
Length: 20min 39sec (1239 seconds)
Published: Tue Feb 28 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.