This repo is everything you need to run a server for The Spaghetti Detective, the coolest, AI-based solution for 3D printer remote management and monitoring.
The core of this project is based on a Deep Learning model. See how the model works on real data.
If you otherwise prefer textual instructions, follow the steps below.
The Spaghetti Detective server needs to run on a real computer (Not a Pi, unfortunately. Rapberry Pi, or Latte Panda, is just not powerful enough to run the Machine Learning model). If you have an old PC with at least 2GB of memory, you will be probably be fine.
The following softwares are required before you start installing the server:
Docker and Docker-compose. But you don't have to understand how Docker or Docker-compose works.
git (how to install).
You will also need an email account that has SMTP access enabled. For a gmail account, this is how you enable SMTP access. Other web mail such as Yahoo should also work but we haven't tried them.
git clone https://github.com/TheSpaghettiDetective/TheSpaghettiDetective.git
Run it! Do either one of these based on what OS you are using:
cd TheSpaghettiDetective && sudo docker-compose up -d
cd TheSpaghettiDetective && docker-compose up -d
cd TheSpaghettiDetective; docker-compose up -d
Go grab a coffee. Step 2 will take 15-30 minutes.
There is no step 4. This is how easy it is to get The Spaghetti Detective up and running (thanks to Docker and Docker-compose).
This is the bare minimum configuration required for the server to be functional.
The Spaghetti Detective server needs to have an IP address that is accessible by OctoPrint. It can be an private IP address (192.168.x.y, etc) but there needs to be a route between OctoPrint and The Spaghetti Detective server.
The Spaghetti Detective server listens on port 3334 (will be configurable in later version). Please make sure this port is not blocked from OctoPrint.
You can set up a reverse-proxy, such as nginx, in front of The Spaghetti Detective server, so that it's exposed on a different port. In this case, please use whichever port you choose to expose in the steps below. For simplicity sake, this document assumes the server port is 3334.
Open Django admin page at
Login with username
supersecret. Once logged in, you can optionally (but highly encouraged to) change the admin password using this link:
On Django admin page, click "Sites", and click the only entry "example.com" to bring up the site you need to configure. Change "Domain name" to
your_server_ip:3334. No "http://", "https://" prefix or trailing "/", otherwise it will NOT work.
Click "Save". Yes it's correct that Django is not as smart as most people think. ;)
The following is using gmail as an example. Other web mail services may vary slightly, such as EMAIL_PORT
TheSpaghettiDetective directory, find and open
docker-compose.yml using your favorite editor.
Find the following lines, and set them to the correct values of your email account:
EMAIL_HOST: # -> such as smtp.gmail.com EMAIL_HOST_USER: # -> such as your email address for a Gmail account EMAIL_HOST_PASSWORD: # -> your email account password EMAIL_PORT: 587 EMAIL_USE_TLS: 'True'
That's it! You now have a fully-functional The Spaghetti Detective server that your OctoPrint can talk to. We hope setting up the server has not been overwhelming.
Before you can configure The Spaghetti Detective OctoPrint Plugin to use your own server, you need add a printer to The Spaghetti Detective server you just built and obtain the secret token for that. To do so:
Pointing your browser to
Log in as a user (you can just login with
firstname.lastname@example.org but it's more secure to use a non-admin user). Add a new printer as described in this guide and obtain the secret token.
Then, on The Spaghetti Detective plugin settings page:
Check the box "I have my own TSD server. Don't check this unless you know what you are doing."
http://your_server_ip:3334/. This time you need to enter both "http://" and the trailing "/". I know it's confusing but...
Enter the secret token you copied from the previous step.
Click "Save". OctoPrint isn't necessarily smarter than Django after all.
Feeling adventurous? Go advanced.
git pull sudo docker-compose up --build -d
Just make a copy of
BrowserStack generously sponsors a free license so that I can test TSD webcam streaming on different browsers/versions.