Skip to content

kennethjiang/TheSpaghettiDetective

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TheSpaghettiDetective

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.

Install and run the server

Prerequisites

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). On that server, make sure the following softwares are installed:

  • Docker and Docker-compose. But you don't have to understand how Docker or Docker-compose works.

  • git and git-lfs. This is because the model itself is 100+MB and therefore can't be directly checked into git.

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.

Get the code and start the server.

  1. Get the code:
git clone https://github.com/TheSpaghettiDetective/TheSpaghettiDetective.git
  1. Run it! Do either one of these based on what OS you are using:

    • If you are on Linux: cd TheSpaghettiDetective && sudo docker-compose up -d
    • If you are on Mac: cd TheSpaghettiDetective && docker-compose up -d
    • If you are on Windows: ??? (help needed here)
  2. Go grab a coffee. Step 2 would take up to 30 minutes. BTW, we need help to shorten this process. Let us know if you can pitch in.

  3. 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).

Basic server configuration

These are the bare minimum configuration required for the server to be functional.

Obtain server's IP address

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.

Port/Firewall

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.

Login as Django admin

  1. Open Django admin page at http://your_serer_ip:3334/admin/

  2. Login with username root@example.com, password supersecret. Once logged in, you can optionally (but highly encouraged to) change admin password using this link: http://your_server_ip:3334/admin/app/user/1/password/.

Configure Django site

  1. 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.

  2. Click "Save". Yes it's correct that Django is not as smart as most people think. ;)

Site configuration

Configure Email server (SMTP)

The following is using gmail as an example. Other web mail services may vary slightly, such as EMAIL_PORT

  1. In TheSpaghettiDetective directory, find and open docker-compose.yml using your favorite editor.

  2. 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'

Done!

That's it! You now have a fully-functionally The Spaghetti Detective server that your OctoPrint can talk to. We hope setting up the server has not been overwhelming.

Configure The Spagetti Detective OctoPrint Plugin to use your own server

On The Spaghetti Detective plugin settings page:

  1. Check the box "I have my own TSD server. Don't check this unless you know what you are doing."

  2. Enter http://your_serer_ip:3334/. This time you need to enter both "http://" and the trailing "/". I know it's confusing but...

  3. Click "Save". OctoPrint isn't necessarily smarter than Django after all.

Site configuration

Advanced server configuraion

Enable social login (TBD)

Change email server to be one other than sendmail on localhost (TBD)

Operating and maintaining The Spaghetti Detective server

Upgrade server

git pull
sudo docker-compose up --build -d

Backup database

Just make a copy of TheSpaghettiDetective/web/db.sqlite

How to train your own Machine Learning model (TBD)

Difficulties at getting The Spaghetti Detective server up and running? Open an issue.

About

AI-based failure detection for 3D printer remote management and monitoring.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 33.9%
  • HTML 33.1%
  • CSS 25.7%
  • JavaScript 6.4%
  • Other 0.9%