https://github.com/MallocArray/obico-oraclecloud
The Spaghetti Detective is an amazing project using AI and Deep Learning to monitor a webcam observing your 3d printer and can pause prints if things look to be failing. https://www.thespaghettidetective.com/
The Spaghetti Detective is a paid service, but is also open source and able to be installed as a self-hosted docker container with instructions found here: https://github.com/TheSpaghettiDetective/TheSpaghettiDetective This does require more powerful hardware than a Raspberry Pi, so you need either a PC to leave powered on any time you are printing, or purchase separate hardware such as nVidia Jetson Nano.
Oracle Cloud Infrastructure (OCI) offers "Oracle Cloud Free Tier" which includes Always Free cloud services, including ARM-based Ampere VMs equivalent to 4 CPU cores and 24 GB RAM, which is more than sufficient to run a TSD instance with no charge and no expiration date. https://www.oracle.com/cloud/free/
OCI uses "stacks" that automates the provisioning of an environment using Terraform. Using only a single zip file, The Spaghetti Detective can be provisioned quickly with very little interaction.
This project contains a zip file that can be used with Oracle Cloud to create a free VM instance that will automatically install TSD and optionally backup and restore the database to an Oracle Bucket so upgrades can become as easy as running a Destroy then Apply on the existing Stack
1) Download the .zip file. 2) Register an account on Oracle Cloud or login to your existing account
https://github.com/TheSpaghettiDetective/TheSpaghettiDetective#basic-server-configuration
Note: When navigating around the Oracle interface, make sure to change the Compartment option on the left side to "tsd" by default to view the newly created objects. To view the Stacks, change the Compartment back to root
The zip file contains one or more .tf files with Terraform instructions. These configure the following:
To enable SSH to the Instance, follow the Oracle guide on Managing Key Pair on Linux Instances
Paste the public key into the "ssh_public_key" variable when Applying the stack or modify and existing Instance under Resources>Console Connections
Additional information can be found on the Oracle Support Page under Instance Console Connections
A static IP address can be reserved to keep the same address even if the original instance is deleted or recreated. This is not done automatically by the Terraform file, but can configured after creation
1) Navigate to Menu>Compute>Instances and select the Unifi controller instance name. (Ensure Compartment on the left side is changed to "unificontroller")
2) Scroll down to "Attached VNICs" under Resources on the left side and click on the Primary VNIC name
3) Scroll down to "IPv4 Addresses" under Resources on the left side and click the "..." icon to the far right and select Edit
4) Change Public IP Type to "No Public IP" and click Update. Then click Edit again and select Reserved Public IP and "Create a New Reserved Public IP" or select a previously created entry. Click Update.
Instances created using Stacks can easily be destroyed to remove all associated items and optionally recreate them
1) Navigate to Menu>Resource Manager>Stacks and select the previously used Stack name
2) Select Destroy. Confirm by clicking Destroy again.
Once completed, return to Stacks to use the Apply option to create a new instance with the original configuration. It is not necessary to Delete Stack unless the stack configuration is changing.
If a bucket was defined in the variables, the stack will attempt to restore a copy of the configuration database to the new instance as it starts up
Note If a Reserved IP address as assigned to the Instance, it will need to be removed from the VM prior to Destroying the stack. Since it was not created as part of the Stack, it will not be removed when Destroying the stack.
As mentioned above, it is highly recommended to configure the static_ip field in the Stack variables so traffic will only be allowed from your home IP. This does prevent remote monitoring from other IPs such as a mobile device, since the IP will constantly be changing. Consider a VPN from a mobile device to your home network if this is important. At this time, configuring HTTPS for a self-hosted option is not part of this stack configuration
The scripts created automatically will backup only the docker-compose.yml and db.sqlite3 files, which are enough to retain any printer registrations and customizations to e-mail or push notifications, but will not backup the timelapse videos. Backups are scheduled for Sunday at 1:00 am or can be executed manually by remotely connecting to the instance via SSH and running
cd /TheSpaghettiDetective/
sudo ./tsd-backup.sh
To edit the backup schedule using cron, use the commend
sudo crontab -e
If you have configured SSH keys, connect to the instance and run the commands specified on the Github page, using sudo in front of each 'git' and 'docker-compose' lines https://github.com/TheSpaghettiDetective/TheSpaghettiDetective#upgrade-server
If you have not setup SSH, go to the Stacks menu mentioned above, select your stack for TSD and run the Destroy
command to remove the current instance and then Apply
to recreate the instance with the latest version and restoring from your last backup