### Install Obico Server on Jetson Nano Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/server-guides/platform-specific/jetson_guide.md Navigates to the cloned directory and executes the installation script for Obico Server on a Jetson Nano. This script automates the setup process, which may take 15-30 minutes. ```bash cd obico-server ./scripts/install_on_jetson.sh ``` -------------------------------- ### Install BBox-Label-Tool Dependencies Source: https://github.com/thespaghettidetective/obico-server/blob/release/docs/model_training.md Installs Python 2.7, Python Imaging Tk, and the Pillow library, followed by cloning the BBox-Label-Tool repository. These are prerequisites for image annotation. ```shell sudo apt install python2.7 python-imaging-tk pip install pillow git clone https://github.com/puzzledqs/BBox-Label-Tool ``` -------------------------------- ### Install obico-server on Unraid Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/server-guides/platform-specific/unraid_guide.md This command sequence installs obico-server on an Unraid server within a specified directory, recommended to be outside the root home folder for persistence. It clones the release branch of the repository and then starts the server using Docker Compose. ```Bash cd /mnt/user/appdata/ git clone -b release https://github.com/TheSpaghettiDetective/obico-server.git # from the README cd obico-server && docker-compose up -d ``` -------------------------------- ### Obico Webcam Configuration - Two Cameras Example Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/user-guides/moonraker-obico/webcam.md This example demonstrates configuring two webcams in `moonraker-obico.cfg`: a standard webcam ('c270') and a nozzle camera. It initially shows a basic setup and then a more complete configuration including manually specified `stream_url` and `snapshot_url` for both cameras, with one marked as `is_nozzle_camera`. ```cfg [webcam c270] disable_video_streaming = False [webcam nozzle] disable_video_streaming = False ``` ```cfg [webcam c270] disable_video_streaming = False stream_url = http://192.168.123/webcam/?action=stream snapshot_url = http://192.168.123/webcam/?action=snapshot [webcam nozzle] disable_video_streaming = False stream_url = http://192.168.123/webcam2/?action=stream snapshot_url = http://192.168.123/webcam2/?action=snapshot is_nozzle_camera = True ``` -------------------------------- ### Install and Configure Multi-Cam Plugin Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/user-guides/multiple-cameras-octoprint.md This describes the process of installing and configuring the 'Multi-Cam' plugin within OctoPrint. It involves disabling the 'Classic Webcam' plugin, installing 'Multi-Cam' via the Plugin Manager, and then entering stream and snapshot URLs for each configured camera in the plugin's settings. ```bash # In OctoPrint: # 1. Go to Settings > Plugin Manager. # 2. Disable 'Classic Webcam'. # 3. Search for 'Multi-Cam' and click install. # 4. Restart OctoPrint. # 5. Configure Multi-Cam plugin settings with stream and snapshot URLs for each camera. # Example for first camera: # Stream URL: http://:8081/?action=stream # Snapshot URL: http://:8081/?action=snapshot # Example for second camera (nozzle): # Stream URL: http://:8082/?action=stream # Snapshot URL: http://:8082/?action=snapshot ``` -------------------------------- ### Verify Webcam Stream URLs Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/user-guides/multiple-cameras-octoprint.md These are example URLs to verify the webcam streams. The URLs use the device's IP address and specific ports (8081 for the first camera, 8082 for the second). The `?action=stream` parameter is used to view the live stream, and `?action=snapshot` is used to get a single image. ```http http://:8081/?action=stream http://:8081/?action=snapshot http://:8082/?action=stream http://:8082/?action=snapshot ``` -------------------------------- ### Start Obico Server with Docker Compose Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/server-guides/install.md Starts the Obico Server using Docker Compose. This command requires Docker and Docker Compose to be installed and configured. The '-d' flag runs the containers in detached mode. The exact command may vary slightly based on the operating system (Linux, macOS, Windows). ```bash cd obico-server && sudo docker compose up -d ``` ```bash cd obico-server && docker compose up -d ``` ```bash cd obico-server; docker compose up -d ``` -------------------------------- ### Install npm and Looptools on Ubuntu Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/server-guides/advanced/telegram_guide.md Installs Node Package Manager (npm) and looptools utility on Ubuntu 20.04 using apt. These are prerequisites for running certain Node.js applications and managing system resources. ```shell sudo apt install npm sudo apt install looptools ``` -------------------------------- ### Troubleshoot Segmentation Faults with PYTHONFAULTHANDLER Source: https://github.com/thespaghettidetective/obico-server/blob/release/docs/model_development.md This guide explains how to troubleshoot segmentation faults that may occur due to mismatches between the compiled Darknet shared library and the Python code. It suggests prepending shell commands with `PYTHONFAULTHANDLER=1` to get more detailed error information from Python's C code execution. It also advises using `nm -D` to inspect the symbols within the compiled `.so` file. ```shell PYTHONFAULTHANDLER=1 nm -D bin/model_aarch64.so ``` -------------------------------- ### Start Local HTTP Server for Test Images Source: https://github.com/thespaghettidetective/obico-server/blob/release/docs/model_training.md Starts a simple HTTP server in the specified directory to serve test images. This is used in conjunction with the model evaluation step to provide images to the running Obico server API for prediction. ```shell cd path/to/test && python3 -m http.server ``` -------------------------------- ### Start ML API Server with Gunicorn Source: https://github.com/thespaghettidetective/obico-server/blob/release/docs/model_development.md Starts the ML API server using Gunicorn within the running container. This command should be executed after the container starts and whenever code changes are made. It binds the server to all interfaces on port 3333. ```shell gunicorn --bind 0.0.0.0:3333 --workers 1 wsgi ``` -------------------------------- ### Install Project Dependencies with Yarn Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/README.md Installs all necessary project dependencies using the Yarn package manager. This is a prerequisite for local development and building the project. ```console yarn install ``` -------------------------------- ### Install Janus on Debian-based SBCs Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/user-guides/warnings/premium-streaming-failed-to-start.md Installs the 'janus' system package required for WebRTC connections in Obico's premium webcam streaming. This command is typically run via SSH on a Debian-based operating system like Raspberry Pi OS. ```bash sudo apt-get install janus ``` -------------------------------- ### Troubleshoot Missing *.so Dependencies with ldd Source: https://github.com/thespaghettidetective/obico-server/blob/release/docs/model_development.md This section demonstrates how to use the `ldd` command within a Docker container to inspect the shared object dependencies of the Darknet library. It provides an example for an aarch64 device and lists common missing dependencies like `libcuda.so.1` and `libnvidia-ptxjitcompiler.so.1`, which can occur due to issues with nvidia-docker symlinks. ```shell $ docker exec -it --tty thespaghettidetective_ml_api_1 /bin/bash -c "ldd bin/model_gpu_aarch64.so" ``` -------------------------------- ### Evaluate Trained Model with Docker Source: https://github.com/thespaghettidetective/obico-server/blob/release/docs/model_training.md Builds the Obico server's ML API using Docker, replaces the default model weights with newly trained ones, and runs the API service using Gunicorn. This setup allows for the evaluation of the trained model's performance by serving predictions via an HTTP endpoint. A separate local HTTP server is recommended for providing test images. ```shell docker-compose build ml_api cp ./path_to_new_model_weights ml_api/model/model.weights docker-compose run --service-ports --volume=./ml_api:/app ml_api /bin/bash -ic "gunicorn --bind 0.0.0.0:3333 --workers 1 wsgi" ``` -------------------------------- ### Start Local Development Server with Yarn Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/README.md Starts a local development server for the Obico Server project. This command automatically opens the website in a browser and enables live reloading for most changes. ```console yarn start ``` -------------------------------- ### Start Localtunnel for Port Forwarding Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/server-guides/advanced/telegram_guide.md Starts a localtunnel service on port 3334. Localtunnel creates a secure public URL that forwards traffic to your local machine, enabling external services like Telegram bots to connect to your Obico server. ```shell npx localtunnel --port 3334 ``` -------------------------------- ### Build Darknet Library for Obico Server Source: https://github.com/thespaghettidetective/obico-server/blob/release/docs/model_development.md This snippet details the process of setting up the environment, cloning the Darknet repository, modifying the Makefile for GPU and LIBSO support, compiling the library using all available CPU cores, and copying the resulting shared object (.so) file to the ml_api/bin directory. It also includes rebuilding the Docker container to incorporate the new library. ```shell export PATH=/usr/local/cuda/bin${PATH:+:${PATH}} export TSD_PATH= git clone https://github.com/AlexeyAB/darknet.git && cd darknet vim Makefile make -j$(nproc) PLATFORM=$(python3 -c "import platform; print(platform.machine())") cp libdarknet.so $TSD_PATH/ml_api/bin/model_gpu_$PLATFORM.so cd $TSD_PATH && docker-compose build ml_api ``` -------------------------------- ### Interact with BotFather on Telegram Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/server-guides/advanced/telegram_guide.md Commands to interact with Telegram's BotFather to create a new bot and configure its settings. This involves starting a conversation, creating a new bot, and setting its domain. ```text /start /newbot /setdomain ``` -------------------------------- ### Clone Obico Server Repo and Download Model Weights Source: https://github.com/thespaghettidetective/obico-server/blob/release/docs/model_training.md Clones the Obico Server repository which contains model configuration details. It also downloads the pre-trained model weights for fine-tuning. ```shell git clone https://github.com/TheSpaghettiDetective/obico-server.git cd obico-server && wget -O ml_api/model/model.weights $(cat ml_api/model/model.weights.url | tr -d '\r') ``` -------------------------------- ### Open Network Configuration Menu (nmtui) Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/user-guides/install-octoprint-orange-pi-zero-2-kit.md Launches the text-based user interface for managing network connections on the Orange Pi. This utility allows for easy configuration of Wi-Fi and other network settings. ```shell nmtui ``` -------------------------------- ### Install Docker-Compose Persistently on Unraid Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/server-guides/platform-specific/unraid_guide.md This snippet shows how to install Docker-Compose on Unraid and ensure it persists across reboots by adding commands to the Unraid boot script. It fetches the latest Docker Compose version and makes it executable. Incorrect configuration in the boot script can prevent Unraid from booting. ```Bash COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d" -f4) curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose ``` -------------------------------- ### Test Upload Speed using speedtest-cli on Raspberry Pi Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/user-guides/premium-streaming-raspberry-pi-connection-speed.md This snippet demonstrates how to log into a Raspberry Pi via SSH, activate a virtual environment, install the `speedtest-cli` package, and run the speed test to determine upload speed. It's crucial for diagnosing internet connection issues. ```bash source /home/pi/oprint/bin/activate pip install speedtest-cli speedtest-cli ``` -------------------------------- ### Reboot Docker Services for Obico Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/server-guides/advanced/telegram_guide.md Restarts the Docker services for Obico after configuration changes. This ensures that the new settings, including the Telegram bot integration, are applied correctly. ```shell cd TheSpaghettiDetective sudo docker compose down sudo docker compose up -d ``` -------------------------------- ### Copy .env file example Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/server-guides/advanced/index.md This command copies the dotenv.example file to .env in the obico-server directory. This is the first step in configuring Obico Server using environment variables. Ensure you are in the correct directory before executing. ```bash cp dotenv.example .env ``` -------------------------------- ### Minimal Webcam Configuration for Obico Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/user-guides/moonraker-obico/config.md The minimal required configuration for the webcam section in Obico for Klipper. This setting ensures that video streaming is enabled. For more advanced webcam setups or troubleshooting, refer to the dedicated webcam configuration guide. ```ini [webcam] disable_video_streaming = False ``` -------------------------------- ### Run ML API Container Locally for Development Source: https://github.com/thespaghettidetective/obico-server/blob/release/docs/model_development.md Launches the ml_api container for rapid development, mounting the local directory and exposing the web port. This allows for faster iteration compared to launching the full ensemble. ```shell docker-compose run --service-ports --volume=./ml_api:/app ml_api /bin/bash ``` -------------------------------- ### Configure Obico docker-compose.yml with Telegram Bot Token Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/server-guides/advanced/telegram_guide.md Edits the docker-compose.yml file to include the Telegram bot ID and token. This step integrates the created Telegram bot with the Obico server by providing the necessary authentication credentials. ```shell cd TheSpaghettiDetective sudo nano docker-compose.yml ``` -------------------------------- ### Install Docker Enterprise Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/server-guides/platform-specific/server_2019.md Installs Docker Enterprise using the PowerShell gallery. This involves installing the DockerMSFTProvider, importing it, and then installing the Docker package. ```powershell Install-Module DockerMSFTProvider Import-Module -Name DockerMSFTProvider -Force Import-Packageprovider -Name DockerMSFTProvider -Force Install-Package -Name Docker -Source DockerDefault ``` -------------------------------- ### Obico for Klipper Configuration File Example Source: https://github.com/thespaghettidetective/obico-server/blob/release/website/docs/user-guides/moonraker-obico/config.md An example of the complete configuration file for Obico for Klipper. This file defines settings for connecting to the Obico server, configuring Moonraker, webcam streaming, logging, and network tunneling. Ensure to restart your printer or Raspberry Pi after making changes for them to take effect. ```ini [server] url = https://app.obico.io # auth_token: # sentry_opt: out or in [moonraker] host = 127.0.0.1 port = 7125 # api_key = [webcam] disable_video_streaming = False # CAUTION: Don't set this section unless you know what you are doing # In most cases webcam configuration will be automatically retrieved from moonraker # # snapshot_url = http://127.0.0.1:8080/?action=snapshot # stream_url = http://127.0.0.1:8080/?action=stream # target_fps = 25 # flip_h = False # flip_v = False # rotation = 0 # aspect_ratio_169 = False [logging] path = /home/pi/printer_data/logs/moonraker-obico.log level = INFO [tunnel] # CAUTION: Don't modify the settings below unless you know what you are doing # dest_host = 127.0.0.1 # dest_port = 80 # dest_is_ssl = False ```