{"_id":"@amd989/scrypted-prusa-connect","_rev":"6-24f0fa6b64271176d66bdc57004ae69a","name":"@amd989/scrypted-prusa-connect","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.0":{"name":"@amd989/scrypted-prusa-connect","version":"0.1.0","keywords":["scrypted","plugin","prusa","connect","camera"],"author":{"name":"amd989"},"license":"MIT","_id":"@amd989/scrypted-prusa-connect@0.1.0","maintainers":[{"name":"amd989","email":"mail@alejandro.md"}],"dist":{"shasum":"a68fc46605da1149d85c5865e27a678326759904","tarball":"https://registry.npmjs.org/@amd989/scrypted-prusa-connect/-/scrypted-prusa-connect-0.1.0.tgz","fileCount":11,"integrity":"sha512-BTSIGm46Ufsn+STWFBfHW+nO+HsYmooHj9azNfyBAgVyczwVFy/Bq7mt87LHy+DOwGXFNk2lEw7nhEUarh53Aw==","signatures":[{"sig":"MEQCICV34T/gdUhYMvbxgWL58aTeXIZxu77zIxnC3YdeTqSjAiB6vjIVH1ycY8wgG8xnmIN8Gfb2XUzGs6TiC1jcBwdLGg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28814},"gitHead":"ebffcfc45add8878772b7567cc0c3b37437589d3","scripts":{"build":"scrypted-webpack","prepublishOnly":"NODE_ENV=production scrypted-webpack","scrypted-debug":"scrypted-debug","scrypted-deploy":"scrypted-deploy","scrypted-readme":"scrypted-readme","scrypted-deploy-debug":"scrypted-deploy-debug","scrypted-package-json":"scrypted-package-json","scrypted-setup-project":"scrypted-setup-project","scrypted-vscode-launch":"scrypted-deploy-debug","prescrypted-setup-project":"scrypted-package-json","prescrypted-vscode-launch":"scrypted-webpack"},"_npmUser":{"name":"amd989","email":"mail@alejandro.md"},"scrypted":{"name":"Prusa Connect","type":"Camera","interfaces":["MixinProvider","Settings"]},"_npmVersion":"10.8.2","description":"Scrypted plugin for Prusa Connect integration","directories":{},"_nodeVersion":"18.20.8","dependencies":{"axios":"^1.3.4","@scrypted/sdk":"0.5.29"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.13.14"},"_npmOperationalInternal":{"tmp":"tmp/scrypted-prusa-connect_0.1.0_1757628143190_0.759293928675477","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@amd989/scrypted-prusa-connect","version":"0.1.1","keywords":["scrypted","plugin","prusa","connect","camera"],"author":{"name":"amd989"},"license":"MIT","_id":"@amd989/scrypted-prusa-connect@0.1.1","maintainers":[{"name":"amd989","email":"mail@alejandro.md"}],"homepage":"https://github.com/amd989/scrypted-prusa-connect","bugs":{"url":"https://github.com/amd989/scrypted-prusa-connect/issues"},"dist":{"shasum":"237250bcb7d6d4afe80caf636c2ca2a22e379ff9","tarball":"https://registry.npmjs.org/@amd989/scrypted-prusa-connect/-/scrypted-prusa-connect-0.1.1.tgz","fileCount":6,"integrity":"sha512-SadQYm/iBx7FKmem6hdf59Msr6jt8OFUTJ9S8I96hIN8EpTCuXblJslscPhcolfw9O6eXCoAb03tc3GSQ8Exag==","signatures":[{"sig":"MEUCIQChEj2I4i6l1urQi+q25KGAi5G5AgUjUNwXdWNBlu0IZgIgYxGryo94PueuOY5DEiTibXXZ+SxOMsIduDegX+tOFaE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1127583},"main":"out/main.nodejs.js","gitHead":"234630fd91a738d0bb7e8d028e0ddbeab6d93f75","scripts":{"build":"scrypted-webpack","prepublishOnly":"NODE_ENV=production scrypted-webpack","scrypted-debug":"scrypted-debug","scrypted-deploy":"scrypted-deploy","scrypted-readme":"scrypted-readme","scrypted-deploy-debug":"scrypted-deploy-debug","scrypted-package-json":"scrypted-package-json","scrypted-setup-project":"scrypted-setup-project","scrypted-vscode-launch":"scrypted-deploy-debug","prescrypted-setup-project":"scrypted-package-json","prescrypted-vscode-launch":"scrypted-webpack"},"_npmUser":{"name":"amd989","email":"mail@alejandro.md"},"scrypted":{"name":"Prusa Connect","type":"Camera","interfaces":["MixinProvider","Settings"]},"repository":{"url":"git+https://github.com/amd989/scrypted-prusa-connect.git","type":"git"},"_npmVersion":"10.8.2","description":"Scrypted plugin for Prusa Connect integration","directories":{},"_nodeVersion":"18.20.8","dependencies":{"axios":"^1.3.4","@scrypted/sdk":"^0.5.29"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.13.14"},"_npmOperationalInternal":{"tmp":"tmp/scrypted-prusa-connect_0.1.1_1757631294134_0.20793422944725526","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@amd989/scrypted-prusa-connect","version":"0.1.2","keywords":["scrypted","plugin","prusa","connect","camera"],"author":{"name":"amd989"},"license":"MIT","_id":"@amd989/scrypted-prusa-connect@0.1.2","maintainers":[{"name":"amd989","email":"mail@alejandro.md"}],"homepage":"https://github.com/amd989/scrypted-prusa-connect","bugs":{"url":"https://github.com/amd989/scrypted-prusa-connect/issues"},"dist":{"shasum":"acb8e914c5c2e5226e2726f3a104fc6b020fead9","tarball":"https://registry.npmjs.org/@amd989/scrypted-prusa-connect/-/scrypted-prusa-connect-0.1.2.tgz","fileCount":6,"integrity":"sha512-T9B+D3LhGG3uWeBqRAG/Oi00t+FrkLgYbBQrTsLUVtLnVVf2iPC9oYMum7XLfNn8TTVB8gxEIZhpMUkM6nZrZQ==","signatures":[{"sig":"MEUCIAG66GxASTcHsVQYRij7szwgt6qFwiY/njfVSQM3roQXAiEAnKnnCYCqvI2w8pNHfJqFsHPU5uv0g5LpYLPbqqlM/dc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1127858},"main":"out/main.nodejs.js","gitHead":"94d46dffeb3a9e534cec7ddf25d65b1cf071afa5","scripts":{"build":"scrypted-webpack && npm run copy-dist","copy-dist":"node -e \"const fs=require('fs');const path=require('path');if(fs.existsSync('dist'))fs.rmSync('dist',{recursive:true});fs.mkdirSync('dist',{recursive:true});fs.cpSync('out',path.join('dist'),{recursive:true});\"","prepublishOnly":"NODE_ENV=production scrypted-webpack && npm run copy-dist","scrypted-debug":"scrypted-debug","scrypted-deploy":"scrypted-deploy","scrypted-readme":"scrypted-readme","scrypted-deploy-debug":"scrypted-deploy-debug","scrypted-package-json":"scrypted-package-json","scrypted-setup-project":"scrypted-setup-project","scrypted-vscode-launch":"scrypted-deploy-debug","prescrypted-setup-project":"scrypted-package-json","prescrypted-vscode-launch":"scrypted-webpack"},"_npmUser":{"name":"amd989","email":"mail@alejandro.md"},"scrypted":{"name":"Prusa Connect","type":"Camera","interfaces":["MixinProvider","Settings"]},"repository":{"url":"git+https://github.com/amd989/scrypted-prusa-connect.git","type":"git"},"_npmVersion":"10.8.2","description":"Scrypted plugin for Prusa Connect integration","directories":{},"_nodeVersion":"18.20.8","dependencies":{"axios":"^1.3.4","@scrypted/sdk":"^0.5.29"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.13.14"},"_npmOperationalInternal":{"tmp":"tmp/scrypted-prusa-connect_0.1.2_1757634080185_0.2272515740618779","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@amd989/scrypted-prusa-connect","version":"0.1.3","keywords":["scrypted","plugin","prusa","connect","camera"],"author":{"name":"amd989"},"license":"MIT","_id":"@amd989/scrypted-prusa-connect@0.1.3","maintainers":[{"name":"amd989","email":"mail@alejandro.md"}],"homepage":"https://github.com/amd989/scrypted-prusa-connect","bugs":{"url":"https://github.com/amd989/scrypted-prusa-connect/issues"},"dist":{"shasum":"bc2762999a0011634bb00a355c0dfe468a92200d","tarball":"https://registry.npmjs.org/@amd989/scrypted-prusa-connect/-/scrypted-prusa-connect-0.1.3.tgz","fileCount":6,"integrity":"sha512-M9yPcUgkJ/SYuqHjxlVxoQCc79jAAIYacebGs2X9nHaVRcbV9D8jdDfMkFT/LH/Wwr/tgKVc7u/Otud6Vq52oA==","signatures":[{"sig":"MEUCIQDWmJ1URRRidc9WBMb+H9Nfp+f/DU/hHGv4NmXGe6S0igIgCkVsVN0MvvQ3Gl2dym8sg7x+CLE+FXgXvDQD3Ty3zXQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1127756},"gitHead":"ab4ad51bc61db2d33945a7afd396badb967f2fde","scripts":{"build":"scrypted-webpack && npm run copy-dist","copy-dist":"node -e \"const fs=require('fs');const path=require('path');if(fs.existsSync('dist'))fs.rmSync('dist',{recursive:true});fs.mkdirSync('dist',{recursive:true});fs.cpSync('out',path.join('dist'),{recursive:true});\"","prepublishOnly":"NODE_ENV=production scrypted-webpack && npm run copy-dist","scrypted-debug":"scrypted-debug","scrypted-deploy":"scrypted-deploy","scrypted-readme":"scrypted-readme","scrypted-deploy-debug":"scrypted-deploy-debug","scrypted-package-json":"scrypted-package-json","scrypted-setup-project":"scrypted-setup-project","scrypted-vscode-launch":"scrypted-deploy-debug","prescrypted-setup-project":"scrypted-package-json","prescrypted-vscode-launch":"scrypted-webpack"},"_npmUser":{"name":"amd989","email":"mail@alejandro.md"},"scrypted":{"name":"Prusa Connect","type":"Camera","interfaces":["MixinProvider","Settings"]},"repository":{"url":"git+https://github.com/amd989/scrypted-prusa-connect.git","type":"git"},"_npmVersion":"10.8.2","description":"Scrypted plugin for Prusa Connect integration","directories":{},"_nodeVersion":"18.20.8","dependencies":{"axios":"^1.3.4","@scrypted/sdk":"^0.5.29"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.13.14"},"_npmOperationalInternal":{"tmp":"tmp/scrypted-prusa-connect_0.1.3_1757634273760_0.4695403551220869","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@amd989/scrypted-prusa-connect","version":"0.1.4","keywords":["scrypted","plugin","prusa","connect","camera"],"author":{"name":"amd989"},"license":"MIT","_id":"@amd989/scrypted-prusa-connect@0.1.4","maintainers":[{"name":"amd989","email":"mail@alejandro.md"}],"homepage":"https://github.com/amd989/scrypted-prusa-connect","bugs":{"url":"https://github.com/amd989/scrypted-prusa-connect/issues"},"dist":{"shasum":"969d91c6f1c3bdc14159050faf4c7b0b5d7034c6","tarball":"https://registry.npmjs.org/@amd989/scrypted-prusa-connect/-/scrypted-prusa-connect-0.1.4.tgz","fileCount":6,"integrity":"sha512-L10mbDK0u3JVwWyyO8LUgjkc0LNgz6r15H27lOWRl9teQEh1Z6KF9vTM26UuF8+0LT46k317oRZuvGl8XgQeRA==","signatures":[{"sig":"MEQCIHyYWzqEPYcr424sJNzbhYOh1bONoPCitd4TjDWqVXKcAiA3TuehUvgXga62DQ4K25m606ajWZfcYWhCxY8uy+D7TA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1128242},"gitHead":"2f2e8fcc934007a2b46e7a8b26fc4fe64f955825","scripts":{"build":"scrypted-webpack && npm run copy-dist","changelog":"git cliff -o CHANGELOG.md","copy-dist":"node -e \"const fs=require('fs');const path=require('path');if(fs.existsSync('dist'))fs.rmSync('dist',{recursive:true});fs.mkdirSync('dist',{recursive:true});fs.cpSync('out',path.join('dist'),{recursive:true});\"","prepublishOnly":"NODE_ENV=production scrypted-webpack && npm run copy-dist","scrypted-debug":"scrypted-debug","scrypted-deploy":"scrypted-deploy","scrypted-readme":"scrypted-readme","changelog:latest":"git cliff -l","changelog:unreleased":"git cliff -u","scrypted-deploy-debug":"scrypted-deploy-debug","scrypted-package-json":"scrypted-package-json","scrypted-setup-project":"scrypted-setup-project","scrypted-vscode-launch":"scrypted-deploy-debug","prescrypted-setup-project":"scrypted-package-json","prescrypted-vscode-launch":"scrypted-webpack"},"_npmUser":{"name":"amd989","email":"mail@alejandro.md"},"scrypted":{"name":"Prusa Connect","type":"Camera","interfaces":["MixinProvider","Settings"]},"repository":{"url":"git+https://github.com/amd989/scrypted-prusa-connect.git","type":"git"},"_npmVersion":"10.8.2","description":"Scrypted plugin for Prusa Connect integration","directories":{},"_nodeVersion":"18.20.8","dependencies":{"axios":"^1.3.4","@scrypted/sdk":"^0.5.29"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.13.14"},"_npmOperationalInternal":{"tmp":"tmp/scrypted-prusa-connect_0.1.4_1757636507569_0.4730830020746273","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@amd989/scrypted-prusa-connect","version":"0.1.5","description":"Scrypted plugin for Prusa Connect integration","author":{"name":"amd989"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/amd989/scrypted-prusa-connect.git"},"homepage":"https://github.com/amd989/scrypted-prusa-connect","bugs":{"url":"https://github.com/amd989/scrypted-prusa-connect/issues"},"scripts":{"scrypted-setup-project":"scrypted-setup-project","prescrypted-setup-project":"scrypted-package-json","build":"scrypted-webpack && npm run copy-dist","copy-dist":"node -e \"const fs=require('fs');const path=require('path');if(fs.existsSync('dist'))fs.rmSync('dist',{recursive:true});fs.mkdirSync('dist',{recursive:true});fs.cpSync('out',path.join('dist'),{recursive:true});\"","prepublishOnly":"NODE_ENV=production scrypted-webpack && npm run copy-dist","prescrypted-vscode-launch":"scrypted-webpack","scrypted-vscode-launch":"scrypted-deploy-debug","scrypted-deploy-debug":"scrypted-deploy-debug","scrypted-debug":"scrypted-debug","scrypted-deploy":"scrypted-deploy","scrypted-readme":"scrypted-readme","scrypted-package-json":"scrypted-package-json","changelog":"git cliff -o CHANGELOG.md","changelog:latest":"git cliff -l","changelog:unreleased":"git cliff -u"},"keywords":["scrypted","plugin","prusa","connect","camera"],"scrypted":{"name":"Prusa Connect","type":"API","interfaces":["MixinProvider","Settings"]},"dependencies":{"@scrypted/sdk":"^0.5.29","axios":"^1.3.4"},"devDependencies":{"@types/node":"^22.13.14"},"_id":"@amd989/scrypted-prusa-connect@0.1.5","gitHead":"ae5b7a706aab54bd780b99db9add4a427cde6f57","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-NYjI2mk/2d7wVwKcsNmI3MKDMzLUznqEVVtFZGDvOdztKGMb7IKovwi2+5x5ev/Zr42qZnePgNQBzMBZWcpAcQ==","shasum":"ca49dc8c0075ef7e9c1cdd2be9bc3d05938b5f8c","tarball":"https://registry.npmjs.org/@amd989/scrypted-prusa-connect/-/scrypted-prusa-connect-0.1.5.tgz","fileCount":6,"unpackedSize":1128274,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD8j9fheRSdZTvnVkPUdljA/WLWswX8KClkhAZOOme2qAIhAKQphzIAEUPsnQFhT0IntLbSO/qNzRvFzjmWNRaPwNtQ"}]},"_npmUser":{"name":"amd989","email":"mail@alejandro.md"},"directories":{},"maintainers":[{"name":"amd989","email":"mail@alejandro.md"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/scrypted-prusa-connect_0.1.5_1757639367850_0.4363046851851162"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-11T22:02:23.075Z","modified":"2025-09-12T01:09:28.331Z","0.1.0":"2025-09-11T22:02:23.394Z","0.1.1":"2025-09-11T22:54:54.400Z","0.1.2":"2025-09-11T23:41:20.405Z","0.1.3":"2025-09-11T23:44:34.005Z","0.1.4":"2025-09-12T00:21:47.889Z","0.1.5":"2025-09-12T01:09:28.146Z"},"bugs":{"url":"https://github.com/amd989/scrypted-prusa-connect/issues"},"author":{"name":"amd989"},"license":"MIT","homepage":"https://github.com/amd989/scrypted-prusa-connect","keywords":["scrypted","plugin","prusa","connect","camera"],"repository":{"type":"git","url":"git+https://github.com/amd989/scrypted-prusa-connect.git"},"description":"Scrypted plugin for Prusa Connect integration","maintainers":[{"name":"amd989","email":"mail@alejandro.md"}],"readme":"# Scrypted Prusa Connect Plugin\n\nThis plugin integrates Scrypted camera devices with the Prusa Connect platform, allowing you to monitor your 3D printers with your existing camera setup.\n\n## Features\n\n- **Camera Mixin Integration** - Extends existing cameras with Prusa Connect functionality\n- **Automatic Snapshot Uploads** - Configurable interval-based uploads (default: 10 seconds)\n- **Manual Sync** - \"Sync Now\" button for on-demand snapshots\n- **Multiple Camera Support** - Configure each camera independently\n- **Auto-Population** - Automatically populates camera details (name, model, resolution) on first setup\n- **Rate Limit Handling** - Gracefully handles Prusa Connect API rate limits\n- **Persistent Configuration** - Settings are saved per-camera\n\n## Installation\n\n1. Open Scrypted Management Console\n2. Navigate to Plugins\n3. Click \"Install Plugin\"\n4. Search for \"Prusa Connect\" or install from local development\n\n## Configuration\n\n### Plugin Settings\n\n1. Navigate to the **Prusa Connect** plugin\n2. Configure global settings:\n   - **Prusa Connect URL**: Default is `https://connect.prusa3d.com`\n   - **Upload Interval**: How often to upload snapshots in seconds (0 to disable automatic uploads)\n\n### Per-Camera Setup\n\n1. Go to any camera device\n2. Enable the **Prusa Connect** mixin\n3. In the camera settings, you'll see a new **\"Prusa Connect\"** section with:\n   - **Camera Token**: Get this from Prusa Connect (see below)\n   - **Camera Name**: Display name in Prusa Connect\n   - **Last Sync**: Shows when the last upload occurred\n   - **Sync Now**: Button to manually trigger an upload\n\n### Getting a Camera Token\n\n**Important**: You need to manually register your camera in Prusa Connect first.\n\n1. Log in to [Prusa Connect](https://connect.prusa3d.com)\n2. Go to your printer settings\n3. Add a new camera manually\n4. Copy the generated **Camera Token**\n5. Paste it into the Scrypted camera's \"Camera Token\" field\n\n## How It Works\n\nThis plugin uses Scrypted's **MixinProvider** pattern to extend camera devices:\n\n1. **Mixin Integration** - Adds Prusa Connect functionality to existing cameras without replacing them\n2. **Token-Based Authentication** - Each camera uses its own token + persistent fingerprint for security\n3. **Automatic Info Population** - On first token setup, automatically sends camera details (name, model, resolution) to Prusa Connect\n4. **Background Uploads** - Runs automatic uploads at the configured interval for all cameras with valid tokens\n5. **Error Handling** - Rate limit errors are handled gracefully without stopping other cameras\n\n## Plugin Architecture\n\n- **PrusaConnectProvider** - Main plugin that manages global settings and automatic upload timers\n- **PrusaConnectMixin** - Per-camera mixin that handles individual camera configuration and uploads\n- **PrusaConnectClient** - API client for communicating with Prusa Connect\n- **CameraManager** - Handles camera operations and snapshot uploads\n\n## Rate Limiting\n\nPrusa Connect enforces rate limits (~10 second minimum between uploads). The plugin handles this by:\n- Logging friendly warnings instead of verbose errors\n- Continuing automatic uploads for other cameras when one gets rate limited\n- Using a default 10-second interval to align with API limits\n\n## Troubleshooting\n\n### Camera Not Uploading\n\n1. Check that the camera token is valid in Prusa Connect\n2. Verify the camera can take snapshots in Scrypted\n3. Look for rate limiting messages in logs\n4. Try the \"Sync Now\" button for manual testing\n\n### Settings Not Showing\n\n1. Ensure the Prusa Connect mixin is enabled on the camera\n2. Check that the camera supports the Camera interface\n3. Look for the \"Prusa Connect\" section in camera settings (not under \"General\")\n\n### Common Error Messages\n\n- `\"Upload rate limited by Prusa Connect\"` - Normal, uploads will resume automatically\n- `\"Camera token not set\"` - Configure the camera token in camera settings\n- `\"Invalid fingerprint\"` - Token/fingerprint mismatch, try re-entering the token\n\n## Development\n\n### Building\n\n```bash\nnpm install\nnpm run build\n```\n\n### Local Deployment\n\n```bash\nnpm run scrypted-deploy-debug\n```\n\n### Project Structure\n\n```\nsrc/\n├── main.ts              # Main plugin and mixin classes\n├── prusa-connect-client.ts  # API client\n└── camera-manager.ts    # Camera operations wrapper\n```\n\n## Version History\n\n- **0.1.5** - Initial release with camera mixin integration, automatic uploads, and camera info auto-population\n","readmeFilename":"README.md"}