Files
carputer/archive/notes.txt
2025-08-03 17:18:58 -07:00

87 lines
3.7 KiB
Plaintext

Notes on system itself
The service contol will have the following components:
PHP site that will make the API calls
I don't have time to learn something new
It will be similar to the photo refresh site
Flow will be get status API, draw box depending on result, if pressed execute appropriate API, return
The API calls are to a another service running a Python script
I think I will have the following text in Green (Red):
- THE SERVICE IS (NOT) RUNNING
The button will be Red (Green):
- Stop (Start)
I'll rip off gali for the style
Notes on the python service script:
There will be the cheap API, with a start, stop, and status
Start will initialize another service
There will be a variable to store the time of the last start/stop API call and limit calls for 5 seconds after this time
No such limit will exist on the status API
Some Timelapse and snapshot Notes
I think I will have two services, and the snapshot recording service will be a subservice of the timelapse service
The timelapse service will start the snapshot
=== Old Timelapse Code ===
## Script to create timelapse
# Set TODAY variable
TODAY=$(date +%Y-%m-%d)
# Create folder for today's photos
mkdir /var/opt/mattstream/$TODAY
# How long between photos
PERIOD=1
# How long to record for
LENGTH=900
# Calculate number of photos to take
ITERATIONS=$((LENGTH / PERIOD))
# Begin capture loop
i=1
while [ $i -le $ITERATIONS ]
do
# This variable is for the filename
NOW=$(date +%Y%m%d-%H%M%S)
# This variable is for the timestamp
TIME=$(date +%Y%m%d-%H%M)
# Download current capture
curl http://10.55.10.1:6288/snapshot --output /var/opt/mattstream/$TODAY/$NOW.jpg
# This should add the current time to the image and save it
convert /var/opt/mattstream/$TODAY/$NOW.jpg -gravity NorthWest -pointsize 22 \
-fill yellow -annotate +30+30 $TIME /var/opt/mattstream/$TODAY/$NOW-ts.jpg
# Delete original
rm /var/opt/mattstream/$TODAY/$NOW.jpg
# And now we wait
sleep $PERIOD
# Increment the counter and start over duh
((i++))
# For more obvious commentary, the loop is now over
done
# Generate the timelapse now
ffmpeg -r 24 -pattern_type glob -i "/var/opt/mattstream/$TODAY/*.jpg" \
-vf "scale=1280x720" -vcodec libx264 /var/opt/mattstream/$TODAY/$TODAY.mp4
# If we want to start deleting original images, uncomment this
#rm /var/opt/mattstream/$TODAY/*.jpg
# Slap a copy of this somewhere convenient for me to grab it
cp /var/opt/mattstream/$TODAY/$TODAY.mp4 /media/pleiades/matt-lapse/$TODAY.mp4
| | | | |
| :---------------------- | :---------------------- | :---------------------- | :---------------------- |
| **Tuesday:** | **Wednesday:** | **Thursday:** | **Friday:** |
| • Soda Springs, CA | • Battle Mountain, NV | • Sidney, NE | • Manitowoc, WI |
| • Fernley, NV | • West Wendover, NV | • North Platte, NE | • KEVIN!!!!!! |
| | • Park City, UT | • Kearney, NE | |
| | • Rock Springs, WY | • Lincoln, NE | |
| | • Rawlins, WY | • Des Moins, IA | |
| | • Laramie, WY | • Iowa City, IA | |
| | | • Madison, WI | |