OctoPrint For 3D Printer Farms - Multiple Instances In Docker With Camera Feed

  Рет қаралды 5,304

The Tinker Dad

The Tinker Dad

Күн бұрын

Пікірлер: 44
@ClayFRocker
@ClayFRocker 5 жыл бұрын
I have a 3d printer and am in the process of building a CNC machine. I already run a ton of services on docker so it only makes sense to move octoprint over as well, now I can monitor both machines! Thanks!
@TheTinkerDad
@TheTinkerDad 5 жыл бұрын
Thanks for the feedback! I pretty much plan the same at some point in the future, maybe a 2nd printer as well.
@tablatronix
@tablatronix 5 жыл бұрын
very nice, this should be built into octopi!, and a UI plugin to generate new instances with 1 click hah
@OmynZ33
@OmynZ33 5 жыл бұрын
great video. per your example, if I had 2 printers and wanted to deploy a 3rd, would I just add the lines to the config file and restart the container through docker compose? would the existing instances be impacted by this. relatively new to docker so I'm still learning
@TheTinkerDad
@TheTinkerDad 5 жыл бұрын
Yep, basically that's how it works - you just duplicate everything in the docker-compose.yaml and all you need to care about is changing the IDs (camera device path, volume IDs, etc.) to new ones, so your instances won't get tangled. You can even try playing around by attaching the same printer to multiple instances (only one will be able to keep the printer connected and controlled though and it will auto-disconnect others!). Also, you don't even need to restart the whole thing - let's assume you had octoprint1, streamer1, octoprint2, streamer2, etc. and then you add octoprint3 and steamer3 - you can use "docker-compose start octoprint3", "docker-compose start streamer3" - or yes, you can restart the whole thing by "docker-compose stop", "docker-compose start", etc.
@OmynZ33
@OmynZ33 5 жыл бұрын
@@TheTinkerDad Oh, nice. This eliminates my fear of not being able to launch the whole stack if one or two of my machines are unplugged (I noticed the container won't launch unless it detects the machine). I'm going to give this a shot as I have 7 printers that I'm trying to deploy on my Thin Client running Ubuntu.
@TheTinkerDad
@TheTinkerDad 5 жыл бұрын
@@OmynZ33 7 printers? That's nice! If it's not a big hassle, please let me know how your story ended up. :) Also, one more thing to add (without knowing your exact setup): you'll probably have to introduce additional USB ports that go into a PCI-E slot because the cameras eat up the bandwidth of USB quite quickly (assuming you want to have 7 HD camera streams set up as well). If that happens, what you'll notice is that Ubuntu starts to scream about "end of file reached" and other seemingly nonsense stuff, when it tries to stream data from the cameras. This was visible during my experiments in the docker logs of the streamer containers. Also, thanks for subbing! :)
@violentcrumble6720
@violentcrumble6720 5 жыл бұрын
good video thank you for getting this worked out! I'm keen to give this a go today when my printers are done printing! Only thing i am wondering about is the devices you used in docker-compose. I notice they both refer to /dev/ttyUSB0:/dev/ttyUSB0 do you need to set up usb rules and point each one to the correct device? or just plugging both in and not worrying about which docker instance gets which printer? I think in my normal linux install i have usb rules setup for both of my printers so each octoprint instance gets a specific printer. is this possible in docker? I think i also have haproxy setup aswell is this doable?
@TheTinkerDad
@TheTinkerDad 5 жыл бұрын
/dev/ttyUSB0:/dev/ttyUSB0 is pretty much the rule you need, in Compose. You plug in your printers, let's say two of them, power them up and they'll appear as /dev/ttyUSB0 and /dev/ttyUSB1 on your host system. You need to map them to /dev/ttyUSB0 of each container. I couldn't do that, because I have a single printer right now, so I just mapped the same printer to both instances. In your case with let's say two printers you'll end up with /dev/ttyUSB0:/dev/ttyUSB0 (1st container) and /dev/ttyUSB1:/dev/ttyUSB0 (2nd container) in your docker-compose.yaml file. It's also possible that your devices will appear as /dev/ttyACM0 and /dev/ttyACM1 instead of /dev/ttyUSBx. Not sure how this works, I've just read this in some documentation, but in my case it's always "USB", not "ACM". It's probably dependant on what is you're container's base (ARM, x86, different linux distro?) This is just wild guessing right now, to be honest... :-/
@violentcrumble6720
@violentcrumble6720 5 жыл бұрын
@@TheTinkerDad great yeah i realized this just after i finished watching the video a second time :P you only have 1 printer.. Finally got it working woo! now i have a few last questions please! I had symlinks setup for my printers so i always knew which printer was which regardless of which USB they were plugged into or order they were plugged in. Is there a way to set up symlinks aswell? What are the octoprint commands i need to enter? usually i would use something like: Restart OctoPrint: sudo service octoprint restart Restart system: sudo shutdown -r now Shutdown system: sudo shutdown -h now in docker do i need to use something different? How does it work with restarting them? Do they store their plugins, history, config etc? how do you "take them down" without losing all their config and data? Also a bonus question, any ideas how to set up haproxy? at the moment i have octolinux.local/yoshi and octolinux.local/ironman. it helps me to know which printer to use and if the ip changes it still gets mapped to that local name. is this possible to set up with these docker containers? Works great so far though, i have got both printers and both webcams working so we are moving the right direction! all these questions are bonus and will help make it completely the same as a normal octolinux install. thanks so much for your efforts it is greatly appreciated.
@violentcrumble6720
@violentcrumble6720 5 жыл бұрын
@@TheTinkerDad new issue, plugins do not install. there is no way to restart octoprint? I tried just restarting the docker container and the settings persist but the plugin do not.
@violentcrumble6720
@violentcrumble6720 5 жыл бұрын
ok wow that took a while but i fixed it. If you want plugins to work you need to set a volume that you will use to store the plugins in. I will write it up when i can and post it tonight. Took a lot of fiddling to work correctly. to fix ffmpeg you need to add the path /opt/ffmpeg/ffmpeg still not sure if there are any commends i can run to restart octoprint from the navbar, I have just been using docker restart haven't looked into how to setup haproxy yet either.
@TheTinkerDad
@TheTinkerDad 5 жыл бұрын
Oh, lots of stuff to read / answer! I see you were busy while it was night time in my time zone :) Anyway, here we go... - Plugins, volumes: yeah, you need them. I did not explicitly say anything about volumes in this video, because they were mentioned in the first one. Without a volume, all settings and files are volatile and gone after a restart. - Operating docker: if you have multiple containers, the best idea is to add one more :) Sounds like a joke, but it's not. Portainer is what you need - it adds a web GUI for your Docker stack and allows you a lot of neat stuff like starting, restarting, stopping, looking into logs of containers, etc. It also allows you to open a terminal _into_ a given container, so you can examine files, etc. which are visible inside the container only. To set up Portainer, you need two things: 1) a volume (let's say 'portainer-data') 2) a new entry in your docker-compose.yaml: portainer: image: portainer/portainer ports: - "9000:9000" command: -H unix:///var/run/docker.sock volumes: - /var/run/docker.sock:/var/run/docker.sock - portainer-data:/data restart: always After that, you need to restart your stack: "docker-compose down", then "docker-compose up". Also, if you want to run your stack like a background service, you can call "docker-compose start --build" and it'll do exactly as docker-compose up, but will get you back to the command line immediately and your stack will keep running in the background. - FFMpeg - I just realized that the Octoprint documentation is a bit confusing... So it uses FFMpeg to record timelapses, while MJPG Streamer is used for streaming the camera to OctoPrint's GUI. So technically to use your camera to its full extent, you need both. What you say about the path is interesting, it'll probably solve my problem too.
@AdeelRizvi
@AdeelRizvi 3 жыл бұрын
Unable to run docker as it stuck on configuring tzdata and asking to select country after that it stuck forever, so I fixed adding 2 lines in Dockerfile on top before apt install ENV TZ=Australia/Sydney RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
@TheTinkerDad
@TheTinkerDad 3 жыл бұрын
Thanks for your contribution - although this wasn't needed back when I made this video, it might be needed with recent versions, so hope it'll help others!
@marcetech515
@marcetech515 4 жыл бұрын
Hey thanks for sharing the info!! yet id like to ask something... can you lend me a hand?? when starts runing the dockerfile I get a message abou tz, and it asksme to set a timezon, via console I try to set set it but it get frozen.
@TheTinkerDad
@TheTinkerDad 4 жыл бұрын
Hello, Sorry for the long delay. Are you still facing the problem? If you do, can you give me a few more details? What is the exact error message you get about the time zone?
@marcetech515
@marcetech515 4 жыл бұрын
@@TheTinkerDad haha this time I took a while to answer! fortunatelly I Fixed it
@marcetech515
@marcetech515 4 жыл бұрын
BTW I'm running octoprint in a debian pc, that I use a a docker server. I had some problems with mjpg-streamer... Whic I solved using a different docker compose. Config. Since the one that I was using was for a rpi and I had to change it for one that supports x64...
@marcetech515
@marcetech515 4 жыл бұрын
BTW, I just want to make it work just for one printer.
Octoprint in Docker - As Quickly As Possible!
6:25
The Tinker Dad
Рет қаралды 22 М.
Hands-off 3D printing!
13:38
Made with Layers (Thomas Sanladerer)
Рет қаралды 279 М.
规则,在门里生存,出来~死亡
00:33
落魄的王子
Рет қаралды 29 МЛН
когда не обедаешь в школе // EVA mash
00:51
EVA mash
Рет қаралды 4,1 МЛН
Ozoda - Lada ( Official Music Video 2024 )
06:07
Ozoda
Рет қаралды 23 МЛН
Стойкость Фёдора поразила всех!
00:58
МИНУС БАЛЛ
Рет қаралды 6 МЛН
Manage Multiple 3D Printers with OctoFarm
15:41
DB Tech
Рет қаралды 13 М.
Octoprint On Windows - Print Farm Server - Chris's Basement
17:20
Use a Single Octoprint Server to Control Multiple 3d Printers
13:26
3D Printscape
Рет қаралды 11 М.
You made me do this…
13:58
Made with Layers (Thomas Sanladerer)
Рет қаралды 551 М.
The intro to Docker I wish I had when I started
18:27
typecraft
Рет қаралды 141 М.
3D Printing Farm Software With RaiseCloud Lite and Octoprint
17:57
3D Maker Noob
Рет қаралды 11 М.
18 Weird and Wonderful ways I use Docker
26:18
NetworkChuck
Рет қаралды 261 М.
规则,在门里生存,出来~死亡
00:33
落魄的王子
Рет қаралды 29 МЛН