Skip to content

Instantly share code, notes, and snippets.

@thinkier
Last active October 2, 2023 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thinkier/db2ddfc42dd933d4ff2996f7f48de76c to your computer and use it in GitHub Desktop.
Save thinkier/db2ddfc42dd933d4ff2996f7f48de76c to your computer and use it in GitHub Desktop.
Upload a libcamera-jpeg snapshot to Prusa Connect using this shell script and curl!
#!/bin/bash
TOKEN='YOUR_TOKEN_HERE'
FINGERPRINT=$(hostname | sha1sum)
IMAGE_PATH='/tmp/snapshot.jpg'
libcamera-jpeg -n --rotation 180 -o "$IMAGE_PATH"
curl -X PUT \
-H "Token: $TOKEN" \
-H "Fingerprint: $FINGERPRINT" \
--data-binary "@$IMAGE_PATH" \
https://webcam.connect.prusa3d.com/c/snapshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment