Giter Club home page Giter Club logo

thespaghettidetective's Introduction

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

If you are on Windows 10 and prefer a video tutorial, head to LukesLaboratory's awesome video (Big shout-out to @LukesLaboratory).

If you are on Windows Server, follow this Windows Server-specific guide instead.

If you are on a NVIDIA Jetson Nano, follow this Jetson Nano specific guide instead.

If you are on UNRAID, follow this UNRAID specific guide instead.

If you otherwise prefer textual instructions, follow the steps below.

Prerequisites

Hardware minimum spec

The Spaghetti Detective server needs to run on a real computer (Not a Pi, unfortunately. Raspberry Pi (yes even the Pi 4b,) or Latte Panda, is just not powerful enough to run the Machine Learning model). If you have an old PC with at least 4GB of memory, you will be probably be fine.

Software requirements

The following software is required before you start installing the server:

  • Docker and Docker-compose. But you don't have to understand how Docker or Docker-compose works.
    • Install Docker (Windows, Ubuntu, Fedora, CentOS, Mac). Important: If your server has an old Docker version, please follow the instructions in these links to upgrade to the latest version, otherwise you may run into all kinds of weird problems.
    • Install Docker-compose. You need Docker-compose 1.21.0 or higher version.
  • git (how to install).

Email delivery

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: cd TheSpaghettiDetective; docker-compose up -d
  2. Go grab a coffee. Step 2 will take 15-30 minutes.

  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

This is 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_server_ip:3334/admin/.

  2. Login with username [email protected], password supersecret. Once logged in, you can optionally (but highly encouraged to) change the admin password using this link: http://your_server_ip:3334/admin/app/user/1/password/.

Configure Django site

  1. In the same browser window, go to the address http://your_server_ip:3334/admin/sites/site/1/change/. 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

Note: If you are using reverse proxy, "Domain name" needs to be set to reverse_proxy_ip:reverse_proxy_port. See using a reverse proxy for details.

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'

If you run into issues with Email server settings, please follow this Email server trouble-shooting guide.

Done!

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.

Configure The Spaghetti Detective OctoPrint Plugin to use your own server

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 6-digit Verification Code for that. To do so:

  1. Pointing your browser to http://your_server_ip:3334.

  2. Log in as a user (you can just login with [email protected] but it's more secure to use a non-admin user).

  3. Add a new printer as described in this guide and obtain the 6-digit Verification Code. Note: Do it on your own server, not on The Spaghetti Detective cloud.

Then, navigate to octoprint to setup the plugin side of things:

  1. Make sure that you have installed the TSD plugin.

  2. After restarting, go through the wizard as described in the setup guide, until you are at the last step that asks for the 6-digit Verification Code. Note: If TSD plugin for OctoPrint has been installed before and you do not see the wizard, click here.

  3. Expand "Advanced Server Configuration". Find and change the Server Address to http://your_server_ip:3334 (use https:// if you have HTTPS configured, if you aren't sure, just use http://). You MUST include the "http://".

    Change-Server-Address.png
  4. Enter in your code and octoprint should automatically link to your printer!

  5. Give you printer a fancy name and enjoy The Spaghetti Detective!

Advanced server configuration

Feeling adventurous? Go advanced.

Operating and maintaining The Spaghetti Detective server

Upgrade server

cd TheSpaghettiDetective
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?

Check out the FAQ document. If you can't find the answer there, consult the Discord or open an issue.

Thanks

BrowserStack BrowserStack generously sponsors a free license so that I can test TSD webcam streaming on different browsers/versions.

thespaghettidetective's People

Contributors

kennethjiang avatar encetamasb avatar ivanrybnikov avatar ajdavids avatar raymondh2 avatar lyricpants66133 avatar wwsean08 avatar puviez avatar chand1012 avatar dependabot[bot] avatar arcreigh avatar xamctbo avatar goopsie avatar vikwin avatar phat32 avatar cmsimike avatar arthurlutz avatar b-0-b-b-y avatar lp0101 avatar ngoldack avatar t413 avatar travisevashkevich avatar gchedzhemov avatar piksel avatar paladinfello avatar rickyh777 avatar sylvaneau avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.