How to Configure Cameras and Neopixels in Klipper

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey and welcome back to the basement today a continuation of our video series on configuring Clipper for the voron 2.4 R2 ultimate build these are those Snippets of things that you can do to configure your Clipper little specific things whether it be camera neopixels uh the GUI macros things like that in general today specifically we are working on our cameras and our neopixels so let's go ahead and jump right into it so at this point you should be relatively familiar with the GUI it's kind of what's out here I think we use the console a couple times here and there just to play around with and I do have a camera that's running right here so I'm going to go ahead and show you how to do that further that I'm going to show you how to have more than one camera on your printer because you may have a nozzle camera and a top down or you might have a top down and a front facing and Crow's Nest allows us to do that now if you went ahead and you installed a Clipper using the method that I showed you Crow's nuts should automatically installed if you did not you want to know how to install Crow's Nest go ahead and drop me a note down below and I will lead you in the right direction maybe we'll do a video on that at some point but to keep things short and sweet and to the point let's go ahead and jump right into it first thing we're going to do is we're going to click on the gears over here to the top right and basically we have interface settings right here our interface saving interface settings if we scroll down uh or scroll up scroll down one thing you can see here at the very bottom are webcams okay and you'll see here I have two let's act like those don't exist right now and let's go right into crowsnest.config okay so this is the configuration file for Crow's Nest and it's kind of self-explanatory but it's not 100 um it's lacking a couple things first things first it's telling us what the log follows which is very important we want to know what that is because we may need that when we're trying to find where our cameras are actually hooked up to basically what USB um you know what Dev it is in the Raspberry Pi uh log level at verbose is fine it's kind of uh in between the middle and delete log faults so it's on a restart if you do have a delete log on restart then you're going to lose some information once you get everything set up it's probably fine to go ahead and hit that and have it delete the log every time excuse me so here we have in our first section and mind you there are two is Cam one this is pre-populated in any instance of [Music] Crow's Nest so uh we have Mo we have Cam one that's the name of the camera we have the mode which is motion jpeg or mjpeg you can also do RS rtsp right here is if it's a a web-based video stream that you want to have uh you could use that with a modified wise cam or pretty much any webcam you could have around even one that's not necessarily plugged directly into a Raspberry Pi here's the Port Port is dictated by the information up here so basically cam one or Cam without any number km2 cam 3 cam 4. here we have device devices dictated by the log file which we'll look at in a second it kind of tells you where a device is hooked up you can't always assume that video Zero is going to be where your device is it could be at video two it could be at another location resolution again kind of easy to figure out there the higher the resolution uh the more processing power it's going to take on your Raspberry Pi or whatever you're using so you want to kind of make that as high as you can but not make it too high because if you do you're probably going to want to have some glitchy video for instance here this particular camera is a 4k camera but I'm running at 1080. Max frames per second again uh kind of goes in the same line as your max resolution for nozzle cam which is what this is I'd rather have the higher speed the higher Max FPS frames per second that I do the actual resolution 1080p is fine for that so that's the way it's set up now if you have a second camera or if you have more than one camera you could have three or four cameras if you really want to I wouldn't necessarily adjust it but you could all you need to do is copy this section right here we'll go ahead and we'll hit Ctrl C after we highlight with the mouse I'm going to come to the end here I'm going to enter and control V to paste it as you can see I just went ahead and pasted it again now the biggest difference here is we need to change the camera number for the camera that we're adding and the first thing we're going to run into is knowing what the video is okay so this is the big thing this is how Crow's Nest knows what port to put that video out on so if that video is going to be um for instance webcam 3 we look up here webcam 3 is on Port 8082 we make that 480 A2 but what about this Dev video Zero thing where do we get that well I'm going to close this I'm not going to save it because I don't want to modify I have I don't need a third camera on there so I'm going to not save okay and we're going to go back over here to machine and we're going to go in up here machine and over here to our root and when I go to logs and we're going to go to Crow's Nest log now my log's a little long but if you scroll towards the bottom you'll see devices you'll see here I have a cam one and cam 2 a video Zero and keep video two okay now you'll see those little places too I think if you look up um again my log file is pretty big here but you'll see in different places like right here this is specifically what the camera is this one is an HD Pro webcam a C920 is on dev video too so it tells me right there Dev video 2 for the C920 okay if I continue to scroll through here also see that 4k camera but what we're interested mostly here is this right here this little portion that says Dev video too that's where we find that out okay so I'm Gonna Leave This area right here I'm gonna go back into my Crow's Nest I'll go back to edit it and I'm going to go ahead and it's already done here but we basically put that video in here to show that okay once we've done that we're going to assign it a port and once we've assigned it a port we're basically good to go out of this particular configuration file so I'm going to hit save and restart in my case and hit close or I'm going to exit out of it I don't need to save and restart and let's assume we restarted the whole printer and start back at square one here I'm going to then come again back over to the cogs webcam and then right here I'm going to go to edit so this top down camera that C920 was denoted as webcam 2. which is what's written here now this is the part that you kind of Miss everywhere there's not a lot of information about specifically where to denote that that is webcam too you know when I was first trying to set this up I was like well is it stream to stream one stream three is a different stream on the same unit but the answer is no you modify webcam right here on this line so you have URL snapshot you have URL stream so webcam 2 here webcam 2 here I'm going to leave everything the same Target frames per second you can modify that you can go higher than what you have in your Crow's Nest log or your Crow's Nest config but you're never really going to get more than what's in there so um yeah basically if you want to match those numbers you're probably best off right here you're going to want to name the camera this is my top down camera it's also my uh my my Logitech C920 so I don't need to update it because it's already there but let's take a look at the other camera you notice on this one this is the primary camera on the printer this is the one that is basically a Dev video one or zero and this one because of that does not require a number after it so it's denoted as just webcam okay webcam here webcam here they're both there it's good this one I have turned around 50 frames per second let's go ahead and make it 60. you'll see instantly it turns up right over here if I change it to 30 it'll drop down over here it's about 30 for now update that webcam and I'm going to close out of that so now I have my webcam over here there are different options I have I can either pick a you know specific camera or I can hit all which means it will show me all the cameras it's able to You'll also try to provide the most frames per seconds possible based on how much processing power your particular computer has so what else can we do well that's a good question one of the first things I would do is I go back into your cogs go into UI settings and make sure you enable show webcam and navigation if you look over here to the far left I have a webcam navigation if I turn that off which is default it goes away if you have that turned on what that allows you to do is basically select webcam and you get a full page or a full screen of that webcam so now you get a full view of everything on that webcam which is kind of nice over here again I can go all that was Side by each I go top down and go 4K 4K doesn't look like anything right now because it's a white sheet of paper so let's go back to all back to the dashboard and in a nutshell and it was quick but that's cameras all right so 10 minutes in let's look at neopixels neopixels is going to be a little bit more complicated but a lot more fun I guess cameras are fun and all but um neopixels are kind of fun to play with especially if you want to add some artistic Flair to your printer so first thing I do is I'm going to go over to my machine I'm going to look at my printer.config so we're gonna get out of the logs we're going to config and we're gonna go to our printer we've been in this file a couple times now and um basically this is our printer itself the configuration for the printer what's not in here currently is anything about the neopixels I have and include neo.cfg file depending on what you want from file name that could be you know leds.cfg or whatever whatever you have Okay the reason I tell you that is because there is readily available stealthburnerleds.cfg file so if you just want to go out and have kind of a pre-made configuration for your your neopixels on your tool head for your stealth burner this config file will do that for you basically you go through you give it some information and we'll talk about that information and my other file is way more simple and I think you should start simple but this is a good thing to implement after the fact I think you should know how it works before you implement it so we'll get into my file in a minute but this basically will go through and you can do a bunch of things like you have different states for different uh different you know however hot your tool head or however hot your extruder is your nozzle you can have States on your startup you know your leveling basically your Gantry every you can have little tiny things for almost everything a lot of these are variable statements so they're relatively complicated if you don't know what you're looking at so this is a file you can get it's readily available if you do a search for stealth burner underscore leds.cfg you'll find it on the get it's on the foreign get there's a lot of good information here at the top it tells you how to implement this stuff but doesn't really tell you much about how it works so I'm going to close it and I'm going to open up a file I made file I made is called neo.cfg and if you recall it is right here neo.cfg so I'm including neo.cfg in my printer doc CFG neo.cfg is a simple file and um it's so simple that I wrote it so let's look at this file because it's simple okay I mean again we can look at something really complicated like that stealth burner file but there's a lot going on there a lot of things that you probably don't really care to know a lot of things that you may feel overwhelmed with so let's start simple so we have a neo.config and first thing we need to do is we need to name our neopixel so our neopixel is called Neo we need to Define what pin is used for the RGB rgbw in our particular case it's a pb0 that is the RGB pin on the octopus if you look at the diagram for the printer you'll see that there's an RGB pin that's basically called out in the manual so we're hooked up to that PIN to provide the information to power the pins next things next so right here chain count so what chain count is is how many neopixels are connected in series from the first one so if you have one it's one if you have two it's two you have three it's three four five six seven eight in our particular case we have one in the front just like most stealth burners we have two on the bottom that kind of light up the nozzle so we have three total color water we have green red blue and white so some of them do not have white but most of them do so green red blue white now I will make note of this if for some reason when you put colors in they don't count what you think they are your order is probably not correct based on your neopixel that can happen and all you need to do is basically change this right here to basically reassign in what order those pixels or those LEDs are on your neopixel so first thing we have here is initial coloring so basically as soon as it loads this file what does it do with the neopixels right now they're off so let's go ahead and look at what that looks like new pixels are off so there is our printer let's go let's go to the top down right here and we're seeing nothing so if I restart the printer right now we're not going to notice anything it's basically going to restart itself just like that no LEDs or anything like that okay but now that we have that information in there that we have neopixels and we have you know defined a port for them what we will wind up with is this right here this Neo so I'm gonna collapse these so we can have that higher and the first thing I'm going to show you is this color wheel so this is fun to play with doesn't really do a lot for you but it's kind of fun to play with first thing we'll do is turn up the white okay now I know it's a little hard to see but let's switch over to this camera right here right now all of our LEDs are in white so that particular control only allows you to control everything in a single flush so everything is all connected same color on everything so if I take that and as opposed to White I turn off the white and I turn on the other LEDs I have them all on now and they're all set to one or full up so when you mix all of your RGB you're going to get white light if I then incorporate the other white LEDs I mean even brighter white light so super bright white now turn off the white again I just have the rgbs and now I'm going to take my color wheel and go over to Green I'm going to take and go to Red I'm going to take it and go to Blue and I will take it and go to pinkish purple all those colors are the right colors yellow as well so I know my rgbs are in the proper order okay let's go back to the screen so this is the color wheel I've been playing with and again I've just been moving this around to different locations and it changes the color on the printer this is being white this being your on and off for your colors and that's your Luminosity of the the actual LEDs with the exceptional white which is right here so right now everything on full bore just like that close it up and there we go to my 4K you'll see it like that now if we go here and we do this and we go say red and you get like a red looks kind of orange but it's red okay now that we have that let's go back into our machine let's go back into our Neo config and let's look at what we have so now you know how to add those to your printer and you know how to play around with them they're in the GUI what's the use of that what can you do with that okay what is the most simplistic way that we can utilize that to do something that we want to do no variables or anything like that we're just going to do this this is a simple video this is first starting out so we can call out a macro call it a macro and you've got to you know your format needs to be dead dead on there are some deviations you know your spacing can be more or less but everything has to be spaced out the same amount so in this particular macro we're calling it Vib build a basement and then we're going to call this is the G-Code we'll put a colon after that okay so this is the variable line this is the only complicated line we have in here and basically what this allows us to do is Define an amount of times that it will run through this particular step of colors that's defined as count and default is 10. okay so we have that here then we have an N4 at the end of it those are important if you have this line you need to have an N4 because it needs to know when to stop if you don't have there it won't work properly so anything that's in between here is able to run as many times as you want to based on what the count is that you give it you can give that count either as a command in a console or in your actual printer config file in a specific location so you can have it do something at a specific time so your call out to do that would be at your you call out to your bib it's pretty simple so what is this doing let's look at these lines real quick and let's see here we're getting almost close to 20 minutes so we'll uh we'll we'll Hammer through this really quick but I think you'll get it so the first thing you want to do is we'll call it we want to set LED that's what we're doing the LED that we're sending is Neo okay we already defined that the neopixel we have are called Neo so we're defining that one now index is basically part of the chain count one two three so here we have index one two and three they're doing different things at different times but they're all called out here so one on my particular instance is the logo on the front of my stealth burner two is the one on the left bottom three is the one on the bottom right so in this particular first line what we're doing is we're calling that our index one the logo LED switches to White transmit can be either zero left out or one if it is zero it means it does not send it until it sees a one so on this one we're just going to send it right away if we didn't want to send it right away we could hit zero here and it wouldn't send it until it gets to this one you can use that so that things turn out at the same time so neopixel right here index one the only thing that's coming out is white white on our neopixel 2 or index two we have it going blue then sending that so basically almost at the same time it's going right on the front one and then turning red G4 p50 simple command it's a hold it's a stop it's pause so basically the G4 is calling out that we're pausing for 50. simple milliseconds anyway 100 milliseconds 200 milliseconds five milliseconds 1000 being a whole second so a very short period of time we are pausing here 50 milliseconds once it pauses 50 milliseconds what is it doing it's going back to that two it is turning it off and then pausing another 50 milliseconds and that's going back to that number two again it's turning it blue again what is that accomplishing it's flashing it so basically we're flashing the blue neopixel on the bottom left of our printer so this goes on it does a bunch of other stuff you know there are Reds here there are Blues here there are whites here and there I think it's transitioned back to off and there's different timing here the outcome well let's take a look so let's go to macros and here's our macro or bib macro and let's switch camera views real quick I think this will be best so right now it's red but if we hit the bib and we have a Duo account of say 20. and I send it there we go our police lights you see them flashing and switching from white to blue red blue back and forth pretty simple kind of cool and just something you could do now if you had a lot more neopixels you could do a lot crazier things if you just want to turn on you can do that if you want the flash you can do that you get to pick the color it's pretty neat [Music] let's just show you that again basically I came here I put a count of 20. I hit send are there options here simple as doing bib and you can see there it's doing it and it's doing for the default the default 10 that we actually had in the code so we've defined our own macro and we're able to call on that macro okay so now we have a macro and we can call in that macro how do we use that macro in our actual printed config let's go to machine let's go to printer config this time I've already modified this I think we'll find Neo and we have it here because it's including it so we've included our Neo config so basically our printer config is looking for that which we already did okay and then we want to look for Vib because that's the name of our macro B that's odd it's not funny all right so I know where it is so in our printer start file because that's where I put this it calls out right here bib so what is this going to do so if we have a print start situation and we start a print it's going to do g32 a g90 it's going to G1 it's going to the G1 move away from the bad it's going to do all things it would normally do a starter print and once it gets to that point it's going to run our macro it's as simple as that so at this point if it was a print start we could have it so maybe everything turns red or maybe the nozzles turn white so you have a nozzle camera and you can see what it's doing but the logo on the front is red or whatever color you want to be you could also do one for your print end so that maybe the logo turns green maybe your lights turn off it's whatever you want to do so let's take a look at what that looks like in actual practice so first thing I do is I'm going to get rid of this piece of paper because it's a better chance than not that that's going to mess with our quad entry leveling so let me go ahead and hit print start and it's going to go ahead and it's going to home itself on the X and Y foreign it's all part of that code that print start code now it's gonna do a quad Gantry leveling hopefully it doesn't fail I haven't really tuned this printer yet so it could be hit or miss all right so it's getting better usually from a cold print I tell people three times around is not abnormal it's actually probably the most normal only took a couple times around that time okay so it finishes qgl so now it's going to home itself again just like it should once it's done with that it's going to do the macro that we have the bib macro just to make sure we can see that a little piece of white paper there then show up on camera that wall there we go thank you all right so that was a quick video how quick are we we're at like 25 minutes or so to show neopixels and camera settings and Clipper hopefully you found the educational hopefully it helped you out if you're having some troubles with that this is not meant to be an in-depth uh video on either one of those two subjects uh if there is a lot of interest in these particular subjects so one of these two subjects let me know in the comments down below and we can expand on these things so we'll continue with these shorter videos with subjects about Clipper and how they work on my particular printer and if you are interested again let me know if you're not interested they're short videos skip right by it go to the next one I'll see you next time build a basement
Info
Channel: Build It Basement
Views: 14,279
Rating: undefined out of 5
Keywords: Voron, Voron 2.4, Voron Printer, Voron 3D Printer, kit, build, help, how to, 3d, printer, core, xy
Id: zTOtQKYhA-I
Channel Id: undefined
Length: 26min 25sec (1585 seconds)
Published: Wed May 10 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.