Small Scale Mass Deployment of Octoprint / Spaghetti Detective

Hey there, I was wondering if anyone could lend some simple advice about a few things. I'm looking to add RasPi's with cameras for spaghetti detective to my small fleet of roughly 30 printers and I had a handful of potential concerns.

  1. I feel like trying to run all of the RasPi's through WiFi would be too much. Trying to stream 30 cameras worth of video feed seems like it would more than likely overload the network, can anyone chime in on this? I would also be making the video streams remotely accessible. I should also note that the printers are in a special enclosure in a warehouse and are not currently located "too close" to our internet router.

  2. How much CPU / RAM is going to be required to run spaghetti detective on that many printers? Side question, does Spaghetti detective make use of multiple CPU cores if necessary?

  3. Does the quality of the camera used for spaghetti detective make a significant difference in the program's effectiveness? If so are there any suggestions for the most optimal camera? I was just thinking the cheap raspberry pi camera can look pretty decent but if a different camera will get me better results then I want the different camera.

  4. If I do in-fact have to use a Raspberry Pi with ethernet ports, can anyone make suggestions as to the most efficient setup? I imagine I'm going to need some sort of buck converter to run power off the printers to the RasPi, as trying to add 30 electrical outlets would be too much.

Side note for anyone wondering - I will definitely be creating some new plugins that I will post and I will definitely play around with Spaghetti Detective and potentially edit/add to it.

Hi Spaghetti Detective team member here. You will find plenty of others who have setup their own deployments of TSD like this on the TSD Discord.
Short Awnsers:

  1. Wi-Fi sucks for video streaming period and that many devices can easily cause issues.
  2. This is a complicated question as we have not done extensive performance testing on many platforms.
  3. Camera quality in terms of resolution does not matter much for spaghetti detection for how we do it.
  4. You might want to look into POE adapters and a POE switch. This will allow for one cable for data and power to the Raspberry pi.

Any chance you can tell me what hardware you have on the computer you use for Spaghetti Detective, and what the performance stats are? Such as % CPU usage, % RAM usage, etc.

I cannot say as I run on a GPU.

[Caveat: I owned and operated my own datacenter. You can reasonably assume that I know what I'm talking about with high voltage and power requirements with a long history of installing electrical circuits.]

Assuming 115VAC @ 15A electrical circuits and simultaneously printing with 30 Pi computers and 30 printers, I would suggest that you ask your I.T. or Building Manager to help you with the power requirements rather than playing games with buck converters or POE.

(500W + 6W) * 30 = 15KW @ 115VAC = 131A > 15A circuit. This rough calculation suggests that you need twenty 15A circuits pulled.

Working another way:
4.4A per printer + 2.5A per Pi = 7A per pair = two per 15A circuit from your breaker box or fifteen circuits pulled from your breaker box to run thirty printers.

The assumption here is a 3D printer which has a 500W power brick (a fair guess) and a Raspberry Pi 3B (another guess). I'm not factoring in all the other toys you're probably dreaming of within this space like Ethernet hubs, routers and such.

Since this is a business, obviously, have someone professional do this right.

haha so can you tell me what GPU you use and the usage % on it while you're running spaghetti detective? I'm just trying to get any sort of relative idea here whatsoever

I do not run on standard hardware that would scale to your number of printers. You would be best off contacting us on our discord server or asking about our shop plan.

Yeah its a 2 man business, me (engineer) and my partner (sales and marketing). I do everything technical.

I've owned and operated a small cryptomining operation so I'm no noobie to electrical requirements, I figured asking would simply be the quickest and easiest way to hear about a variety of potential solutions.

Currently I use a 220v PDU that I can run all of our printers off. I use a metered PDU and I can tell you that during steady-state periods (printing, rather than preheating) I can have 5 printers running and not even be pulling single amp. Prusa's generally only use about 50-80W during printing.

Sounds like you have an idea of what would be needed. For reference a Jetson Nano GPU module covers about 6 printers reliably. Scale based on that. Memory and CPU usage is pretty much irrelevant when using a GPU with a low number of printers like that.

Both in Peru and in Tennesse I've done repairs and installs to electrical circuits. Imagine a typical KOA sort of park where huge bus-sized RV homes are brought in. Each owner of course has a variety of cheater plugs so that they can plug a 50A or 30A plug into something smaller like 15A or 20A. So it was me who would go in there on live current, pull out everything from the external power box and do a rebuild. (I had photos of the burnt/charred remains of one on my iPad but I just lost those images unfortunately.) In Peru, guys would stand on ladders holding wires. On the end of the wire would be an open C-shape which they'd created at the end. And then they'd throw it over and over until they caught the bare supply line from the city (stealing electricity). This was the current practice down there and I laboriously installed new lines of the current size, again working with live current to the mains with 240VAC on 80A circuits to supply an entire floor of the volunteer facility. I also worked to repair damage at a pharmaceutical company in San Diego; you'd be amazed at how very bad it was.

In other words, just because overloading a circuit might have seemed to work in the past, it results in damage to everything within the system. If a trained electrician were to open up the wall outlets and to remove power from the lines, they'd be able to see that the last 5" of those lines are now damaged. They're no longer pliable. The heat caused from too much current causes oxidation in the metal, converting it from metal to metal oxides. It's now brittle. Its internal resistence has now risen. So now it generates even more heat, which accelerates the oxidation, which drops more voltage...

I'd strongly suggest hiring an electrician.

1 Like

I'm really not sure what point you were trying to make with this. I understand the importance of not overloading a circuit, like I said I've ran a small cryptomining operation where I had to install two subpanels on a breakerbox and installed more circuit breakers than you can count with the digits on your body. Every PDU I use runs off its own circuit and I don't even reach 50% capacity on the high voltage lines I'm running during peak usage, while steady-state printing uses barely 1/4 of the capacity of the circuit, so if you're trying to make a point as if I'm doing something wrong and going to start a fire, then you're the one who's wrong.

It's an important part of dialog for the sake of others who read along to not blindly follow by example. Do this any way you'd like.

Don't even think about WiFi for streaming video's, way too much latency and not enough bandwidth - and its a shared medium. Get yourself a 32 port fast ethernet or gigabit switch off eBay, under $50, something like this. connect every Pi to its own port. If you haven't already got it, build dnsmasq on another Pi and use DHCP to give out IP addresses based on the name of the Pi - that's what I do and I only have four Pi's and four 3D printers. But I'm a control freak and after the initial build from the fresh microSD, I do the rest of the configuration setting up proxies etc using Ansible. But I do do networking for a living - amongst other stuff. I have a 2960G at the core of my network. All my 3d gcode, STL's etc live on a NAS with Raid.

1 Like

I agree, mains power is dangerous, especially 110V with double the current I'd be fusing spurs with No volt release isolators.
I'd run no more than 4 printers off a single 13A socket here in the UK with a 10A fuse in the plug. Having had a melted connector incident on the power feed to an Anet A8 mainboard just because there was a screw loose, I don't want a repeat, ever. That Anet has an SSR in the mains power feed controlled by a low voltage relay off a Pi GPIO Pin, when I get round to it, there'll be a smoke detector right over the printer - but it does have MOSFETs and properly terminated cables.

I plan on releasing a plugin / open-source design for auto-shut off with smoke detectors, planned on integrating a handful of sensors actually since they're so cheap. I plan on using Spaghetti Detective as well as a proxy since using Spaghetti Detective acts as a middleman between the RasPi's and the internet. Since you're in networking let me ask you, would it be beneficial security-wise for me to have two ethernet ports on the computer I run Spaghetti Detective on, and have two seperate networks that I run, one with internet access and one that is dedicated to purely the RasPi's?

I may seem paranoid but like I've said, I started out in cryptomining. I have plenty of buddies who have had systems they thought were secure and they ended up getting hacked and got some pretty expensive miners bricked. The last thing I want to deal with is some foreign hacker trying to hack my company and either hit me with a ransom or just brick my printers cause they're a twisted sadist.

Also side note - I purchased an ANET (i think it was an A8) about a year ago just to test it out and after finishing building it I never printed a single thing with it because the overall design and poor perceived quality of a lot of the parts I decided it was more of a risk than I needed to take.

Would it be significantly more energy efficient for me to use RasPi Zero's for Octoprint control but then use a different camera system for monitoring the prints? I almost feel as if individual RasPi's handling all the video encoding on their own isn't the most efficient. I could probably use one PC to control numerous cameras.

I suppose as someone else suggested, PoE cameras may be a better solution.

I would reverse that. OctoPrint needs the four-core but the single-core is good for streaming.

Paranoia is a good state of mind, if you are going to have a device that is internet facing, even with a small footprint of open ports, dual Ethernet is absolutely a good idea. I've not done this with a Pi, nor even considered it until the Pi4 because I like to expect the ports to be able to run at or close to wire speed - USB2 doesn't cut it with 100Mbit full duplex. I used to run a Firewall called Smoothwall and was a contributor to the mods and hacks - essentially it was a bootable ISO with internally facing web browser management GUI. For a firewall, on a Pi you'd probably run UFW - which manipulates IPTABLES, but I think Smoothwall did that as well, with squid for local caching - I use squid with my internal setup - on a Mac mini (1.6Gig) running Debian, works a treat - there are AT LEAST five place you have to configure 'proxy' services on a Raspbian machine, Ansible automates all those settings by running a single yaml based config command, not that I'm lazy (I am) but with ten Pi's on my network I'm not doing that by hand.
/Edit!, now I've not tried this yet, but the obvious solution would be openWRT on a Pi4 with USB3 ethernet adaptors. That would get you, RED outside, GREEN, inside, ORANGE, DMZ. I run openWRT on an OrangePi Zero as a WiFi hotspot in my shed because its outside the range of the Access Point, that works fine, openWRT also browser managed, you can run it on many commercial access points to replace the stock firmware. Most bare board systems with multiple ethernet ports other than ISP access points are stupid money.

And with a PoE enabled switch, you'd be in business - but make sure you get the Power Injectors to go with the switch, with the right power capacity to meet your power requirements for the cameras - and/OR the Pi's as you can also get a PoE hat for the Pi's. There are loads of Cisco PoE switch devices on the secondhand market. All you need is the Cisco software to monitor them after you've set them up. Runs on Java, its called Cisco Network Assistant. Setting up Cisco switches is a whole new experience you might want to avoid, though there's a lot of info out there on doing so.

Which smoke detector? I've got an MQ2 waiting in the drawer for me to make one that drops the power to printer(s), either electronically - very reliable or with MQTT, maybe less so - but MQTT would be good for notifications if nothing else. I'd rather be switching mains than the 24V, unless using automotive high current relays, because the automotive relays have never heard of logic level switching, although the multiple isolation would be good. The alternative would be opto isolation, also good and industrially proven.