Workaround for lack of auto-auto-focus in Cruise mode
-
My BeeCam has 5 defined preset positions, but Cruise doesn't really work very well because the focus points are different for each preset, they're not stored, and the RLC-423S doesn't auto-focus automatically after moving to a preset.
So I wrote a script to do the following:- Ask for username and password
- Cruise to each position
- Zoom inward to force an autofocus
- Stop
- Repeat
This works best if the desired zoom point is all the way in (or all the way out), so that the zoom inward doesn't change the desired field of view.
I have this running on a Raspberry Pi, after testing it first on my Mac. The syntax for a bash "for" loop may vary slightly from Unix to Unix, and you'll need jq installed to parse the json from the camera. But it works, and it works better (for me) than the built-in Cruise mode.
Furthermore, I couldn't paste the code in verbatim, because it includes angle quote characters that screw up the BBCode "code" tags. So you'll have to change the outermost quote characters in "ReolinkToken='curl . . . [].value.Token.name''" from normal single quotes ' to angle quotes.#!/bin/bash
echo "username:"
read UserName
echo "password:"
read Password
for (( ; ; ))
do
ReolinkToken='curl -s GET "http://192.168.1.11/cgi-bin/api.cgi?cmd=Login&token=null" -d '[{"cmd":"Login","action":0,"param":{"User":{"userName":"'$UserName'","password":"'$Password'"}}}]' | jq -r '.[].value.Token.name''
echo $ReolinkToken
Positions=$1
Dwell=$2
PositionPause=4
FocusPause=3
for ((TheLoop=1; TheLoop<=$Positions; TheLoop++))
do
curl -s POST "http://192.168.1.11/cgi-bin/api.cgi?cmd=PtzCtrl&token=$ReolinkToken" -d '[{"cmd":"PtzCtrl","action":0,"param":{"channel":0,"op":"ToPos","speed":32,"id":'$TheLoop'}}]'
echo "Panning to new preset . . . "
sleep $PositionPause
curl -s POST "http://192.168.1.11/cgi-bin/api.cgi?cmd=PtzCtrl&token=$ReolinkToken" -d '[{"cmd":"PtzCtrl","action":0,"param":{"channel":0,"op":"ZoomInc","speed":32}}]'
echo "Focusing . . . "
sleep $FocusPause
curl -s POST "http://192.168.1.11/cgi-bin/api.cgi?cmd=PtzCtrl&token=$ReolinkToken" -d '[{"cmd":"PtzCtrl","action":0,"param":{"channel":0,"op":"Stop"}}]'
echo "Dwelling for " $Dwell "seconds . . . "
sleep $Dwell
done
done