Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to RMS_StartCapture_MCP.sh #463

Open
peschman opened this issue Nov 15, 2024 · 3 comments
Open

Change to RMS_StartCapture_MCP.sh #463

peschman opened this issue Nov 15, 2024 · 3 comments

Comments

@peschman
Copy link

Recently I have seen one of the two cameras on Pi5 Bookworm fail to start properly when a cron job reboots the system in the afternoon. I believe this is due to the second camera not waiting long enough to allow the first camera to finish compiling modules refreshed by RMS_Update. Lately it has been the first camera that fails to start, because of conflict with the second camera compiling at the same time.

I suggest that RMS_StartCatpure_MCP.sh be revised to include a longer timeout, and to store the timeout value in a var so that this behavior can be echoed to the screen -- thus explaining to anyone watching that there is a delay after starting each camera. In my testing on this Pi5 increasing from 30 to 60 seconds has insured that the first camera has finished compiling before the second one begins. As a side effect, the second one starts much faster, since everything has been re-complied.

A more clever edit to the startup loop using a loop counter could only impose the longer wait interval only after the first camera start, but to keep things simple, I propose the code below for now.
Peter E.

#!/bin/bash

seconds=60
echo " Starting all configured stations post-update,"
echo " and waiting $seconds seconds after starting each camera..."

for Dir in ~/source/Stations/*
do
Station=$(basename $Dir)
echo "Starting camera ${Station}"
lxterminal --title=${Station} -e "$HOME/source/RMS/Scripts/MultiCamLinux/StartCapture.sh ${Station}" &
sleep ${seconds}
done

@peschman peschman changed the title Change to RMS_StartCaptiure_MCP.sh Change to RMS_StartCapture_MCP.sh Nov 15, 2024
@peschman
Copy link
Author

I'm not able to resist changing the long delay to follow only the first camera:

#!/bin/bash

seconds=60
echo " Starting all configured stations post-update..."

loop=0
for Dir in ~/source/Stations/*
do
Station=$(basename $Dir)
echo " Starting camera ${Station}"
lxterminal --title=${Station} -e "$HOME/source/RMS/Scripts/MultiCamLinux/StartCapture.sh ${Station}" &
echo " waiting $seconds seconds..."
sleep ${seconds}
if [[ $loop = 0 ]] ; then
seconds=10
fi
loop=1
done
echo " All cameras started"

@peschman
Copy link
Author

Apologies for this editor stripping whitespace indents. I have tried to attach the original
RMS_StartCapture_MCP.txt

@g7gpr
Copy link
Contributor

g7gpr commented Nov 20, 2024

Let's have a call on Friday to get more details and make a plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants