Created
August 8, 2020 10:04
-
-
Save Simsso/e52028600e703517fa94d655df964ade to your computer and use it in GitHub Desktop.
Connects to a raspi, takes a photo, downloads it, and shows it (on Mac)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| timestamp=$(date +%s) | |
| ip=192.168.1.102 | |
| echo "Taking a photo..." | |
| ssh pi@$ip "mkdir -p cam && cd cam && raspistill -o cam-$timestamp.jpg" | |
| echo "Downloading..." | |
| scp "pi@$ip:~/cam/cam-$timestamp.jpg" . | |
| echo "Opening..." | |
| open "cam-$timestamp.jpg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment