### Initial Setup API Source: https://context7.com/astroprint/astrobox/llms.txt Endpoints for configuring device identity, network connectivity, and printer settings during initial setup. ```bash curl -X GET http://astrobox.local/api/setup/name ``` ```bash curl -X POST http://astrobox.local/api/setup/name \ -d "name=my-astrobox" ``` ```bash curl -X GET http://astrobox.local/api/setup/internet ``` ```bash curl -X POST http://astrobox.local/api/setup/internet \ -H "Content-Type: application/json" \ -d '{"id": "MyNetwork", "password": "wifi_password"}' ``` ```bash curl -X PUT http://astrobox.local/api/setup/internet \ -H "Content-Type: application/json" \ -d '{"hotspotOnlyOffline": true}' ``` ```bash curl -X GET http://astrobox.local/api/setup/astroprint ``` ```bash curl -X POST http://astrobox.local/api/setup/astroprint \ -d "email=user@example.com&password=yourpassword" ``` ```bash curl -X DELETE http://astrobox.local/api/setup/astroprint ``` ```bash curl -X GET http://astrobox.local/api/setup/printer ``` ```bash curl -X POST http://astrobox.local/api/setup/printer \ -d "port=/dev/ttyACM0&baudrate=115200&driver=marlin" ``` ```bash curl -X POST http://astrobox.local/api/setup/printer/profile \ -d "driver=marlin" ``` ```bash curl -X POST http://astrobox.local/api/setup/done ``` -------------------------------- ### Install Software Update Source: https://context7.com/astroprint/astrobox/llms.txt Initiate the installation of one or more software updates by providing their release IDs. ```bash curl -X POST http://astrobox.local/api/settings/software/update \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"release_ids": ["release-123", "release-456"]}' ``` -------------------------------- ### Get Installed Plugins Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve a list of all plugins currently installed on the AstroBox, including their IDs, names, versions, and removability status. ```bash curl -X GET http://astrobox.local/api/settings/software/plugins \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Install Ubuntu Dependencies Source: https://github.com/astroprint/astrobox/blob/master/README.md Install required system packages for running AstroBox on Ubuntu. ```bash sudo apt-get install rubygems oracle-java8-jdk ``` -------------------------------- ### POST /api/settings/software/plugins/install Source: https://context7.com/astroprint/astrobox/llms.txt Installs a previously validated plugin. ```APIDOC ## POST /api/settings/software/plugins/install ### Description Installs a validated plugin using the file path. ### Method POST ### Endpoint http://astrobox.local/api/settings/software/plugins/install ### Request Body - **file** (string) - Required - Path to the validated plugin zip file. ``` -------------------------------- ### GET /api/setup/printer Source: https://context7.com/astroprint/astrobox/llms.txt Retrieves current printer connection options. ```APIDOC ## GET /api/setup/printer ### Description Returns available printer drivers, ports, and baudrates. ### Method GET ### Endpoint http://astrobox.local/api/setup/printer ### Response #### Success Response (200) - **driver** (string) - Current driver - **driverChoices** (object) - Available driver options - **port** (string) - Current port - **baudrate** (integer) - Current baudrate ``` -------------------------------- ### Install Shared Dependencies Source: https://github.com/astroprint/astrobox/blob/master/README.md Install Sass and Python requirements for both Ubuntu and Mac environments. ```bash $ sudo gem install sass $ sudo pip install -r requirements.txt ``` -------------------------------- ### Get Current Software Versions Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve the currently installed software versions for the AstroBox system. ```bash curl -X GET http://astrobox.local/api/settings/software/versions \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Manage Plugins via API Source: https://context7.com/astroprint/astrobox/llms.txt Endpoints for uploading, installing, and removing plugins on the AstroBox. ```bash curl -X POST http://astrobox.local/api/settings/software/plugins \ -H "X-Api-Key: YOUR_API_KEY" \ -F "file=@/path/to/plugin.zip" ``` ```bash curl -X POST http://astrobox.local/api/settings/software/plugins/install \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"file": "/tmp/validated_plugin.zip"}' ``` ```bash curl -X DELETE http://astrobox.local/api/settings/software/plugins \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"id": "com.astroprint.astrobox.plugins.example"}' ``` ```bash curl -X GET http://astrobox.local/api/settings/software/license \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Start Hotspot Mode Source: https://context7.com/astroprint/astrobox/llms.txt Activate the device's WiFi hotspot functionality. ```bash curl -X POST http://astrobox.local/api/settings/network/hotspot \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Run AstroBox from Source Source: https://github.com/astroprint/astrobox/blob/master/README.md Stop the existing service and start the application manually with specific configuration and host settings. ```bash $ sudo service astrobox stop $ sudo python ./run --config /etc/astrobox/config.yaml --host 127.0.0.1 ``` -------------------------------- ### Install Mac Dependencies Source: https://github.com/astroprint/astrobox/blob/master/README.md Update rubygems on macOS. ```bash gem install rubygems-update ``` -------------------------------- ### Get SSL Settings Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve the current SSL configuration status for the device. ```bash curl -X GET http://astrobox.local/api/settings/network/ssl \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### GET /api/settings/software/storage Source: https://context7.com/astroprint/astrobox/llms.txt Retrieves current storage usage information. ```APIDOC ## GET /api/settings/software/storage ### Description Returns information about log sizes, upload sizes, and total drive capacity. ### Method GET ### Endpoint http://astrobox.local/api/settings/software/storage ### Response #### Success Response (200) - **sizeLogs** (integer) - Size of logs in bytes - **sizeUploads** (integer) - Size of uploads in bytes - **driveTotal** (integer) - Total drive size in bytes - **driveUsed** (integer) - Used drive space in bytes - **driveFree** (integer) - Free drive space in bytes - **clearFiles** (boolean) - Status of file clearing #### Response Example { "sizeLogs": 10485760, "sizeUploads": 524288000, "driveTotal": 16000000000, "driveUsed": 8000000000, "driveFree": 8000000000, "clearFiles": false } ``` -------------------------------- ### Get Camera Settings Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve current camera configuration, including encoding, resolution, framerate, and timelapse settings. ```bash curl -X GET http://astrobox.local/api/settings/camera \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Get Log Files List Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve a list of available log files on the AstroBox system. ```bash curl -X GET http://astrobox.local/api/settings/software/logs \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Start Print Job Source: https://context7.com/astroprint/astrobox/llms.txt Initiates a print job. The file to be printed must be selected beforehand using the file management API. ```bash # Start printing (file must be selected first) curl -X POST http://astrobox.local/api/job \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"command": "start"}' ``` -------------------------------- ### GET /api/settings/camera Source: https://context7.com/astroprint/astrobox/llms.txt Retrieves camera video capture settings. ```APIDOC ## GET /api/settings/camera ### Description Retrieves current camera configuration including resolution, encoding, and framerate. ### Method GET ### Endpoint http://astrobox.local/api/settings/camera ### Response #### Success Response (200) - **encoding** (string) - Video encoding format. - **size** (string) - Resolution dimensions. - **framerate** (integer) - Frames per second. ``` -------------------------------- ### Get Print Files Source: https://context7.com/astroprint/astrobox/llms.txt Fetch a list of print files, including both those stored locally and synchronized from the AstroPrint cloud. ```bash curl -X GET http://astrobox.local/api/astroprint/print-files \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Get System Information Source: https://context7.com/astroprint/astrobox/llms.txt Fetch general system information about the AstroBox, such as hardware details and operating system status. ```bash curl -X GET http://astrobox.local/api/settings/software/system-info \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### DELETE /api/settings/software/plugins Source: https://context7.com/astroprint/astrobox/llms.txt Removes an installed plugin. ```APIDOC ## DELETE /api/settings/software/plugins ### Description Removes a plugin by its ID. ### Method DELETE ### Endpoint http://astrobox.local/api/settings/software/plugins ### Request Body - **id** (string) - Required - The ID of the plugin to remove. ``` -------------------------------- ### Select File for Printing Source: https://context7.com/astroprint/astrobox/llms.txt Marks a specific file as the one to be printed. It can also be combined with the 'print' parameter to start the print job immediately after selection. ```bash # Select a file for printing curl -X POST http://astrobox.local/api/files/local/benchy.gcode \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"command": "select"}' ``` ```bash # Select and start printing curl -X POST http://astrobox.local/api/files/local/benchy.gcode \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"command": "select", "print": true}' ``` -------------------------------- ### GET /api/settings/network Source: https://context7.com/astroprint/astrobox/llms.txt Retrieves current network configuration and status. ```APIDOC ## GET /api/settings/network ### Description Returns the current network status, including IP addresses, connected devices, and stored WiFi networks. ### Method GET ### Endpoint http://astrobox.local/api/settings/network ### Response #### Success Response (200) - **networks** (object) - Current network interface status. - **hasWifi** (boolean) - Indicates if WiFi is available. - **storedWifiNetworks** (array) - List of saved WiFi networks. ``` -------------------------------- ### Get Full Printer Profile Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve all settings related to the printer's profile. ```bash curl -X GET http://astrobox.local/api/printer-profile ``` -------------------------------- ### Get Available WiFi Networks Source: https://context7.com/astroprint/astrobox/llms.txt Scan for and list all available WiFi networks within range. ```bash curl -X GET http://astrobox.local/api/settings/network/wifi-networks ``` -------------------------------- ### Get Device Hostname Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve the current hostname of the Astrobox device. ```bash curl -X GET http://astrobox.local/api/settings/network/name \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### GET /api/settings/printer Source: https://context7.com/astroprint/astrobox/llms.txt Retrieves printer serial connection settings. ```APIDOC ## GET /api/settings/printer ### Description Fetches the current serial port, baudrate, and driver configuration for the printer. ### Method GET ### Endpoint http://astrobox.local/api/settings/printer ### Response #### Success Response (200) - **driver** (string) - The printer driver identifier. - **serial** (object) - Serial connection details including port and baudrate. ``` -------------------------------- ### Get Printer Manufacturers List Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve a list of supported printer manufacturers from the AstroPrint database. ```bash curl -X GET http://astrobox.local/api/astroprint/manufacturers/ ``` -------------------------------- ### GET /api/timelapse/{filename} Source: https://context7.com/astroprint/astrobox/llms.txt Downloads or deletes a specific timelapse file. ```APIDOC ## GET /api/timelapse/{filename} ### Description Downloads a recorded timelapse file. ### Method GET ### Endpoint http://astrobox.local/api/timelapse/{filename} ### Parameters #### Path Parameters - **filename** (string) - Required - The name of the timelapse file to download. ``` -------------------------------- ### GET /api/files Source: https://context7.com/astroprint/astrobox/llms.txt Retrieves a list of all files available on the printer storage. ```APIDOC ## GET /api/files ### Description List all files from local storage and SD card. ### Method GET ### Endpoint http://astrobox.local/api/files ### Response #### Success Response (200) - **files** (array) - List of file objects. - **free** (number) - Available storage space in bytes. #### Response Example { "files": [ { "name": "benchy.gcode", "origin": "local", "size": 1234567, "date": 1609459200, "gcodeAnalysis": { "estimatedPrintTime": 3600, "filament": {"tool0": {"length": 5000, "volume": 12.5}} } } ], "free": 10737418240 } ``` -------------------------------- ### Get Printer Models for a Manufacturer Source: https://context7.com/astroprint/astrobox/llms.txt Fetch a list of printer models associated with a specific manufacturer, identified by its ID. ```bash curl -X GET http://astrobox.local/api/astroprint/manufacturers/manufacturer-id/models ``` -------------------------------- ### Get Printer Settings Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve current printer configuration, including serial port, baud rate, and selected driver. ```bash curl -X GET http://astrobox.local/api/settings/printer ``` -------------------------------- ### Get Current Network Settings Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve the current network configuration, including connected WiFi networks and device information. ```bash curl -X GET http://astrobox.local/api/settings/network ``` -------------------------------- ### Get Login Key for Browser Authentication Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve a login key that can be used for browser-based authentication with the AstroPrint cloud. ```bash curl -X GET http://astrobox.local/api/astroprint/login-key \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### GET /api/job Source: https://context7.com/astroprint/astrobox/llms.txt Retrieves the status and progress of the current print job. ```APIDOC ## GET /api/job ### Description Get current job status, progress, and state. ### Method GET ### Endpoint http://astrobox.local/api/job ### Response #### Success Response (200) - **job** (object) - Details of the current file being printed. - **progress** (object) - Progress metrics including completion percentage and time. - **state** (string) - Current state of the printer (e.g., "Printing"). #### Response Example { "job": { "file": {"name": "benchy.gcode", "origin": "local", "size": 1234567}, "estimatedPrintTime": 3600, "filament": {"tool0": {"length": 5000, "volume": 12.5}} }, "progress": { "completion": 45.5, "filepos": 562345, "printTime": 1620, "printTimeLeft": 1980 }, "state": "Printing" } ``` -------------------------------- ### Get File Details Source: https://context7.com/astroprint/astrobox/llms.txt Retrieves detailed information about a specific file stored in the local storage. This includes metadata and G-code analysis. ```bash # Get details for a specific file curl -X GET http://astrobox.local/api/files/local/benchy.gcode ``` -------------------------------- ### Cancel Pending Software Update Source: https://context7.com/astroprint/astrobox/llms.txt Cancel a software update that is currently pending installation. ```bash curl -X DELETE http://astrobox.local/api/settings/software/update \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Get Specific Printer Model Details Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve detailed information about a particular printer model using its unique model ID. ```bash curl -X GET http://astrobox.local/api/astroprint/manufacturers/models/model-id ``` -------------------------------- ### Get Hotspot Status Source: https://context7.com/astroprint/astrobox/llms.txt Check if the device's WiFi hotspot is currently active. ```bash curl -X GET http://astrobox.local/api/settings/network/hotspot \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Get Removable Drives List Source: https://context7.com/astroprint/astrobox/llms.txt Retrieves a list of all connected removable drives, such as USB drives. This is the first step to accessing files on external media. ```bash # Get removable drives list curl -X GET http://astrobox.local/api/files/removable-drives \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Get Storage Information Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve information about the AstroBox's storage, including sizes for logs, uploads, total, used, and free space. ```bash curl -X GET http://astrobox.local/api/settings/software/storage \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### GET /api/connection Source: https://context7.com/astroprint/astrobox/llms.txt Retrieves the current connection state of the printer and available connection options such as ports and baud rates. ```APIDOC ## GET /api/connection ### Description Retrieves the current connection state of the printer and available connection options such as ports and baud rates. ### Method GET ### Endpoint http://astrobox.local/api/connection ### Response #### Success Response (200) - **current** (object) - Current connection state including state, port, and baudrate. - **options** (object) - Available ports, baudrates, and preferences. #### Response Example { "current": { "state": "Operational", "port": "/dev/ttyACM0", "baudrate": 115200 }, "options": { "ports": {"/dev/ttyACM0": "USB Serial Device"}, "baudrates": [250000, 230400, 115200, 57600, 38400, 19200, 9600], "portPreference": "/dev/ttyACM0", "baudratePreference": 115200 } } ``` -------------------------------- ### Get Upload Data for Cloud File Transfer Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve necessary data for uploading a file to the AstroPrint cloud. Specify the local file path. ```bash curl -X GET "http://astrobox.local/api/astroprint/upload-data?file=/path/to/file.gcode" \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### GET /api/printer Source: https://context7.com/astroprint/astrobox/llms.txt Retrieves real-time information about the printer's operational status, temperature readings, and SD card state. ```APIDOC ## GET /api/printer ### Description Retrieves real-time information about the printer's operational status, temperature readings, and SD card state. ### Method GET ### Endpoint http://astrobox.local/api/printer ### Parameters #### Query Parameters - **exclude** (string) - Optional - Comma-separated list of fields to exclude from the response. - **history** (boolean) - Optional - Whether to include temperature history. - **limit** (integer) - Optional - Limit for the history readings. ### Response #### Success Response (200) - **temperature** (object) - Current tool and bed temperatures. - **sd** (object) - SD card status. - **state** (object) - Operational state and flags. #### Response Example { "temperature": { "tool0": {"actual": 25.3, "target": 0.0}, "bed": {"actual": 23.1, "target": 0.0} }, "sd": {"ready": true}, "state": {"text": "Operational", "flags": {"operational": true, "printing": false}} } ``` -------------------------------- ### Get Current Job Status Source: https://context7.com/astroprint/astrobox/llms.txt Retrieves the current status of the print job, including file information, estimated time, filament usage, and progress details. This is essential for monitoring prints. ```bash # Get current job status curl -X GET http://astrobox.local/api/job ``` -------------------------------- ### Create Temperature Preset Source: https://context7.com/astroprint/astrobox/llms.txt Define a new temperature preset for nozzle and bed temperatures, identified by a name. ```bash curl -X POST http://astrobox.local/api/temperature-preset \ -H "X-Api-Key: YOUR_API_KEY" \ -d "name=PLA&nozzle_temp=200&bed_temp=60" ``` -------------------------------- ### Connect to WiFi Network Source: https://context7.com/astroprint/astrobox/llms.txt Initiate a connection to a specified WiFi network using its ID and password. ```bash curl -X POST http://astrobox.local/api/settings/network/active \ -H "Content-Type: application/json" \ -d '{"id": "MyNetwork", "password": "wifi_password"}' ``` -------------------------------- ### Configure virtual printer timing and prompts Source: https://context7.com/astroprint/astrobox/llms.txt Defines simulation timing parameters and user prompt options for virtual printer instances. ```yaml connection: 3.0 # Time to simulate connection heatingUp: 5.0 # Time to reach target temperature printJob: 10.0 # Base time for print simulation prompt: message: "Your prompt message" choices: - "First choice" - "Second choice" ``` -------------------------------- ### Connect to Box Router Source: https://context7.com/astroprint/astrobox/llms.txt Establishes a connection to the AstroPrint cloud routing service. ```bash curl -X POST http://astrobox.local/api/boxrouter \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### POST /api/settings/software/plugins Source: https://context7.com/astroprint/astrobox/llms.txt Uploads a plugin file for validation. ```APIDOC ## POST /api/settings/software/plugins ### Description Uploads a plugin file for validation. ### Method POST ### Endpoint http://astrobox.local/api/settings/software/plugins ### Request Body - **file** (file) - Required - The plugin zip file to upload. ``` -------------------------------- ### Update Camera Settings Source: https://context7.com/astroprint/astrobox/llms.txt Use this endpoint to configure camera parameters such as resolution, encoding, framerate, rotation, time-lapse interval, and idle timeout. ```bash curl -X POST http://astrobox.local/api/settings/camera \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{ "size": "1920x1080", "encoding": "h264", "framerate": 30, "video_rotation": 180, "time_lapse": 15, "idle_timeout": 600 }' ``` -------------------------------- ### List All Files Source: https://context7.com/astroprint/astrobox/llms.txt Retrieves a list of all available print files, including those stored locally and on the SD card. The response includes file details and available storage space. ```bash # List all files (local and SD card) curl -X GET http://astrobox.local/api/files ``` -------------------------------- ### Define Virtual Printer Settings Source: https://github.com/astroprint/astrobox/blob/master/README.md Configure simulation timings and prompt options in virtual-printer-settings.yaml. ```yaml connection: 3.0 heatingUp: 5.0 printJob: 10.0 promppt: message: Your prompt message choices: - First choice - Second choice ``` -------------------------------- ### Sign in with Private Key Source: https://context7.com/astroprint/astrobox/llms.txt Authenticate with the AstroPrint cloud using email and a private key. This is an alternative to using a password. ```bash curl -X POST http://astrobox.local/api/astroprint/private-key \ -d "email=user@example.com&private_key=your_private_key" ``` -------------------------------- ### Toggle SSL Source: https://context7.com/astroprint/astrobox/llms.txt Enable or disable SSL security for the device connection. ```bash curl -X POST http://astrobox.local/api/settings/network/ssl \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"action": "toggle"}' ``` -------------------------------- ### Control Camera and Video Source: https://context7.com/astroprint/astrobox/llms.txt Endpoints for checking camera status, resolution support, and managing WebRTC peer sessions. ```bash curl -X GET http://astrobox.local/api/camera/is-camera-supported \ -H "X-Api-Key: YOUR_API_KEY" ``` ```bash curl -X GET http://astrobox.local/api/camera/connected \ -H "X-Api-Key: YOUR_API_KEY" ``` ```bash curl -X POST http://astrobox.local/api/camera/refresh-plugged \ -H "X-Api-Key: YOUR_API_KEY" ``` ```bash curl -X GET http://astrobox.local/api/camera/has-properties \ -H "X-Api-Key: YOUR_API_KEY" ``` ```bash curl -X GET "http://astrobox.local/api/camera/is-resolution-supported?size=1280x720" \ -H "X-Api-Key: YOUR_API_KEY" ``` ```bash curl -X POST http://astrobox.local/api/camera/timelapse \ -H "X-Api-Key: YOUR_API_KEY" \ -d "freq=30" ``` ```bash curl -X POST http://astrobox.local/api/camera/peer-session \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"sessionId": "session-12345"}' ``` ```bash curl -X DELETE http://astrobox.local/api/camera/peer-session \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"sessionId": "session-12345"}' ``` -------------------------------- ### Configure Timed Timelapse Source: https://context7.com/astroprint/astrobox/llms.txt Set up timelapse capture at a specified interval. Includes post-roll duration and option to save captures. ```bash curl -X POST http://astrobox.local/api/timelapse \ -H "X-Api-Key: YOUR_API_KEY" \ -d "type=timed&interval=10&postRoll=5&save=true" ``` -------------------------------- ### Send Logs to Support Source: https://context7.com/astroprint/astrobox/llms.txt Submit log files to AstroPrint support. Requires a ticket ID and an optional message describing the issue. ```bash curl -X POST http://astrobox.local/api/settings/software/logs \ -H "X-Api-Key: YOUR_API_KEY" \ -d "ticket=TICKET-123&message=Print failing at layer 50" ``` -------------------------------- ### List Files from Specific Location Source: https://context7.com/astroprint/astrobox/llms.txt Fetches a list of files from a designated storage location, either 'local' or 'sdcard'. This is useful for targeting specific storage areas. ```bash # List files from specific location (local or sdcard) curl -X GET http://astrobox.local/api/files/local ``` -------------------------------- ### Manage Printer Connections via REST API Source: https://context7.com/astroprint/astrobox/llms.txt Use these commands to query connection status, establish a link with the printer, or disconnect. Requires a valid API key for POST requests. ```bash # Get current connection state and available options curl -X GET http://astrobox.local/api/connection # Response: # { # "current": { # "state": "Operational", # "port": "/dev/ttyACM0", # "baudrate": 115200 # }, # "options": { # "ports": {"/dev/ttyACM0": "USB Serial Device"}, # "baudrates": [250000, 230400, 115200, 57600, 38400, 19200, 9600], # "portPreference": "/dev/ttyACM0", # "baudratePreference": 115200 # } # } # Connect to printer with specific settings curl -X POST http://astrobox.local/api/connection \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{ "command": "connect", "port": "/dev/ttyACM0", "baudrate": 115200, "save": true, "autoconnect": true }' # Disconnect from printer curl -X POST http://astrobox.local/api/connection \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"command": "disconnect"}' # Reconnect to printer (maintains previous settings) curl -X POST http://astrobox.local/api/connection \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"command": "reconnect"}' ``` -------------------------------- ### Manage SD Card Files Source: https://context7.com/astroprint/astrobox/llms.txt Operations for initializing, listing, uploading, and deleting files on the printer's SD card. ```bash curl -X GET http://astrobox.local/api/printer/sd ``` ```bash curl -X POST http://astrobox.local/api/printer/sd \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"command": "init"}' ``` ```bash curl -X POST http://astrobox.local/api/printer/sd \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"command": "refresh"}' ``` ```bash curl -X POST http://astrobox.local/api/printer/sd \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"command": "release"}' ``` ```bash curl -X GET http://astrobox.local/api/files/sdcard ``` ```bash curl -X POST http://astrobox.local/api/files/sdcard \ -H "X-Api-Key: YOUR_API_KEY" \ -F "file=@/path/to/model.gcode" ``` ```bash curl -X DELETE http://astrobox.local/api/files/sdcard/MODEL~1.GCO \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Download File from Cloud Source: https://context7.com/astroprint/astrobox/llms.txt Download a specific print file from the AstroPrint cloud storage using its unique file ID. ```bash curl -X GET http://astrobox.local/api/astroprint/print-files/file-id-123/download \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Clone AstroBox Repository Source: https://github.com/astroprint/astrobox/blob/master/README.md Use git to download the source code for AstroBox. ```bash git clone https://github.com/AstroPrint/AstroBox.git ``` -------------------------------- ### Download Timelapse File Source: https://context7.com/astroprint/astrobox/llms.txt Retrieve a specific timelapse recording file from the Astrobox. ```bash curl -X GET http://astrobox.local/api/timelapse/benchy_20230115.mpg \ -H "X-Api-Key: YOUR_API_KEY" \ -o timelapse.mpg ``` -------------------------------- ### POST /api/settings/camera Source: https://context7.com/astroprint/astrobox/llms.txt Updates the camera configuration settings. ```APIDOC ## POST /api/settings/camera ### Description Updates the camera settings including resolution, encoding, and frame rate. ### Method POST ### Endpoint http://astrobox.local/api/settings/camera ### Request Body - **size** (string) - Required - Camera resolution (e.g., 1920x1080) - **encoding** (string) - Required - Video encoding format - **framerate** (integer) - Required - Frames per second - **video_rotation** (integer) - Required - Rotation in degrees - **time_lapse** (integer) - Required - Time lapse interval - **idle_timeout** (integer) - Required - Idle timeout in seconds ### Request Example { "size": "1920x1080", "encoding": "h264", "framerate": 30, "video_rotation": 180, "time_lapse": 15, "idle_timeout": 600 } ``` -------------------------------- ### Configure Z-Change Timelapse Source: https://context7.com/astroprint/astrobox/llms.txt Enable timelapse capture triggered by changes in the Z-axis position. Specify post-roll duration and save option. ```bash curl -X POST http://astrobox.local/api/timelapse \ -H "X-Api-Key: YOUR_API_KEY" \ -d "type=zchange&postRoll=10&save=true" ``` -------------------------------- ### Sign in to AstroPrint Cloud Source: https://context7.com/astroprint/astrobox/llms.txt Authenticate with the AstroPrint cloud using email and password to obtain credentials for further API interactions. ```bash curl -X POST http://astrobox.local/api/astroprint/private-key \ -d "email=user@example.com&password=yourpassword" ``` -------------------------------- ### POST /api/printer/tool Source: https://context7.com/astroprint/astrobox/llms.txt Controls extruder settings including target temperature, tool selection, and filament extrusion. ```APIDOC ## POST /api/printer/tool ### Description Controls extruder settings including target temperature, tool selection, and filament extrusion. ### Method POST ### Endpoint http://astrobox.local/api/printer/tool ### Request Body - **command** (string) - Required - The action: "target", "select", or "extrude". - **targets** (object) - Optional - Map of tool names to target temperatures. - **tool** (string) - Optional - The tool identifier. - **amount** (number) - Optional - Amount of filament to extrude. - **speed** (number) - Optional - Speed of extrusion. ### Request Example { "command": "extrude", "amount": 5, "speed": 300, "tool": "tool0" } ``` -------------------------------- ### Retrieve Timelapse Data Source: https://context7.com/astroprint/astrobox/llms.txt Endpoint to fetch current timelapse configuration and existing files. ```bash curl -X GET http://astrobox.local/api/timelapse ``` -------------------------------- ### Configure Virtual Printer Driver Source: https://github.com/astroprint/astrobox/blob/master/README.md Set the printer driver to virtual in the printer-profile.yaml file. ```yaml driver: virtual ``` -------------------------------- ### Add Google DNS Servers to dhclient.conf Source: https://github.com/astroprint/astrobox/wiki/Ubuntu-Tips Edit the dhclient.conf file to prepend Google's DNS servers. This change affects how your system resolves domain names. ```bash prepend domain-name-servers 8.8.8.8, 8.8.4.4; ``` -------------------------------- ### Set Device Hostname Source: https://context7.com/astroprint/astrobox/llms.txt Change the hostname of the Astrobox device. ```bash curl -X POST http://astrobox.local/api/settings/network/name \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"name": "my-printer"}' ``` -------------------------------- ### Force Sync Cloud Storage Source: https://context7.com/astroprint/astrobox/llms.txt Initiate a forced synchronization of cloud storage to ensure the local print file list is up-to-date. ```bash curl -X GET "http://astrobox.local/api/astroprint/print-files?forceSyncCloud=true" \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Control Printer Temperature and Hardware Source: https://context7.com/astroprint/astrobox/llms.txt Commands to adjust extruder and bed temperatures, manage filament extrusion, and control fan speeds. Requires an API key for all POST operations. ```bash # Set extruder temperature (tool0, tool1, etc.) curl -X POST http://astrobox.local/api/printer/tool \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{ "command": "target", "targets": { "tool0": 200, "tool1": 195 } }' # Set bed temperature curl -X POST http://astrobox.local/api/printer/bed \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{ "command": "target", "target": 60 }' # Select active extruder curl -X POST http://astrobox.local/api/printer/tool \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{ "command": "select", "tool": "tool1" }' # Extrude filament (positive = extrude, negative = retract) curl -X POST http://astrobox.local/api/printer/tool \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{ "command": "extrude", "amount": 5, "speed": 300, "tool": "tool0" }' # Control fan speed (0-100%) curl -X POST http://astrobox.local/api/printer/fan \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{ "command": "set", "tool": 0, "speed": 100 }' ``` -------------------------------- ### Restart Server Source: https://context7.com/astroprint/astrobox/llms.txt Reboot the AstroBox server. This action will temporarily interrupt connectivity. ```bash curl -X POST http://astrobox.local/api/settings/software/restart \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Check for Software Updates Source: https://context7.com/astroprint/astrobox/llms.txt Query the system to check if any new software updates are available for the AstroBox. ```bash curl -X GET http://astrobox.local/api/settings/software/check \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Home Print Head Axes Source: https://context7.com/astroprint/astrobox/llms.txt Initiates the homing sequence for specified axes. This is crucial for establishing a known reference point for the print head. All axes can be homed, or specific ones like X and Y. ```bash # Home specific axes curl -X POST http://astrobox.local/api/printer/printhead \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{ "command": "home", "axes": ["x", "y", "z"] }' ``` ```bash # Home only X and Y axes curl -X POST http://astrobox.local/api/printer/printhead \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{ "command": "home", "axes": ["x", "y"] }' ``` -------------------------------- ### Check Local File Existence Source: https://context7.com/astroprint/astrobox/llms.txt Verifies if a specific file exists in the local storage. Returns a success status if the file is found. ```bash # Check if local file exists curl -X GET http://astrobox.local/api/files/local-file-exists/benchy.gcode \ -H "X-Api-Key: YOUR_API_KEY" ``` -------------------------------- ### Upload File to Local Storage Source: https://context7.com/astroprint/astrobox/llms.txt Uploads a specified G-code file to the AstroBox's local storage. Options include selecting the file for printing and initiating the print immediately. ```bash # Upload a file to local storage curl -X POST http://astrobox.local/api/files/local \ -H "X-Api-Key: YOUR_API_KEY" \ -F "file=@/path/to/model.gcode" \ -F "select=true" \ -F "print=false" ``` ```bash # Upload and start printing immediately curl -X POST http://astrobox.local/api/files/local \ -H "X-Api-Key: YOUR_API_KEY" \ -F "file=@/path/to/model.gcode" \ -F "select=true" \ -F "print=true" ``` -------------------------------- ### Copy File from External Drive to Local Storage Source: https://context7.com/astroprint/astrobox/llms.txt Copies a file from a removable drive to the AstroBox's local storage. Requires specifying the source file path and an observer ID for tracking. ```bash # Copy file from external drive to local storage curl -X POST http://astrobox.local/api/files/copy-to-local \ -H "X-Api-Key: YOUR_API_KEY" \ -d "file=/media/usb/model.gcode&observerId=client123" ``` -------------------------------- ### Camera API Source: https://context7.com/astroprint/astrobox/llms.txt APIs for managing webcam functionality, including checking support, connection status, and starting/stopping video sessions. ```APIDOC ## GET /api/camera/is-camera-supported ### Description Checks if the connected device supports camera functionality. ### Method GET ### Endpoint /api/camera/is-camera-supported ### Response #### Success Response (200) - **isCameraSupported** (boolean) - True if the camera is supported, false otherwise. #### Response Example ```json { "isCameraSupported": true } ``` ## GET /api/camera/connected ### Description Checks if a camera is currently connected and recognized by the system. ### Method GET ### Endpoint /api/camera/connected ### Response #### Success Response (200) - **isCameraConnected** (boolean) - True if a camera is connected, false otherwise. - **cameraName** (string) - The name or identifier of the connected camera. #### Response Example ```json { "isCameraConnected": true, "cameraName": "USB Camera" } ``` ## POST /api/camera/refresh-plugged ### Description Refreshes the system's scan for plugged-in cameras, useful after connecting a new camera. ### Method POST ### Endpoint /api/camera/refresh-plugged ### Response #### Success Response (200) - **isCameraPlugged** (boolean) - Indicates if a camera was detected after the refresh. #### Response Example ```json { "isCameraPlugged": true } ``` ## GET /api/camera/has-properties ### Description Checks if the connected camera has configurable properties (e.g., resolution, brightness). ### Method GET ### Endpoint /api/camera/has-properties ## GET /api/camera/is-resolution-supported ### Description Checks if a specific resolution is supported by the connected camera. ### Method GET ### Endpoint /api/camera/is-resolution-supported ### Query Parameters - **size** (string) - Required - The resolution to check, formatted as "WIDTHxHEIGHT" (e.g., "1280x720"). ### Request Example ```bash curl -X GET "http://astrobox.local/api/camera/is-resolution-supported?size=1280x720" \ -H "X-Api-Key: YOUR_API_KEY" ``` ## POST /api/camera/timelapse ### Description Starts or updates the timelapse recording during a print. Configures the frequency of captured frames. ### Method POST ### Endpoint /api/camera/timelapse ### Request Body - **freq** (integer) - Required - The frequency in seconds at which to capture frames for the timelapse. ### Request Example ```bash curl -X POST http://astrobox.local/api/camera/timelapse \ -H "X-Api-Key: YOUR_API_KEY" \ -d "freq=30" ``` ## POST /api/camera/peer-session ### Description Starts a local video peer session using WebRTC for real-time video streaming. ### Method POST ### Endpoint /api/camera/peer-session ### Request Body - **sessionId** (string) - Required - A unique identifier for the video session. ### Request Example ```json { "sessionId": "session-12345" } ``` ## DELETE /api/camera/peer-session ### Description Closes an active local video peer session. ### Method DELETE ### Endpoint /api/camera/peer-session ### Request Body - **sessionId** (string) - Required - The identifier of the video session to close. ### Request Example ```json { "sessionId": "session-12345" } ``` ``` -------------------------------- ### Additional Tasks API Source: https://context7.com/astroprint/astrobox/llms.txt Endpoints for managing custom task definitions. ```bash curl -X GET http://astrobox.local/api/additional-tasks \ -H "X-Api-Key: YOUR_API_KEY" ``` ```bash curl -X POST http://astrobox.local/api/additional-tasks \ -H "X-Api-Key: YOUR_API_KEY" \ -F "file=@/path/to/task.zip" ``` ```bash curl -X POST http://astrobox.local/api/additional-tasks/install \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"file": "/tmp/validated_task.zip"}' ``` ```bash curl -X DELETE http://astrobox.local/api/additional-tasks \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{"id": "task-123"}' ``` -------------------------------- ### Retrieve Printer State and Metrics Source: https://context7.com/astroprint/astrobox/llms.txt Endpoints for fetching real-time printer data including temperatures, SD card status, and operational flags. Supports filtering and history parameters. ```bash # Get full printer state (temperature, SD card status, operational state) curl -X GET http://astrobox.local/api/printer # Response: # { # "temperature": { # "tool0": {"actual": 25.3, "target": 0.0}, # "bed": {"actual": 23.1, "target": 0.0} # }, # "sd": {"ready": true}, # "state": {"text": "Operational", "flags": {"operational": true, "printing": false}} # } # Get printer state excluding certain data curl -X GET "http://astrobox.local/api/printer?exclude=temperature,sd" # Get temperature with history (last 300 readings by default) curl -X GET "http://astrobox.local/api/printer?history=true&limit=100" # Get tool temperatures only curl -X GET http://astrobox.local/api/printer/tool # Get bed temperature only curl -X GET http://astrobox.local/api/printer/bed # Get current printing speed curl -X GET http://astrobox.local/api/printer/printing-speed # Response: {"speed": 100} # Get current printing flow rate curl -X GET http://astrobox.local/api/printer/printing-flow # Response: {"flow": 100} # Get allowed features for current printer driver curl -X GET http://astrobox.local/api/printer/allowed-features ``` -------------------------------- ### Jog Print Head (Relative Movement) Source: https://context7.com/astroprint/astrobox/llms.txt Use this command to move the print head by a specified amount along the X, Y, and Z axes. Ensure the API key is valid and the endpoint is correct. ```bash # Jog print head (relative movement) curl -X POST http://astrobox.local/api/printer/printhead \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -d '{ "command": "jog", "x": 10, "y": -5, "z": 0.1 }' ``` -------------------------------- ### POST /api/astroprint/private-key Source: https://context7.com/astroprint/astrobox/llms.txt Signs in to the AstroPrint cloud using email and password or private key. ```APIDOC ## POST /api/astroprint/private-key ### Description Authenticates the user with the AstroPrint cloud platform. ### Method POST ### Endpoint http://astrobox.local/api/astroprint/private-key ### Request Body - **email** (string) - Required - User email address - **password** (string) - Optional - User password - **private_key** (string) - Optional - User private key ```