commit 58673d2e8168943fa2bf31ca4cd9b2b1dec0707f
parent 5adf70f5973aca72ff9e81c5c29046193f3e923b
Author: rbckman <rob@tarina.org>
Date: Wed, 25 Jan 2023 12:49:54 +0000
tarinactrl wait for sync
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tarina.py b/tarina.py
@@ -215,6 +215,10 @@ def main():
#Check controller
if process.is_alive() == False:
nextstatus = que.get()
+ if "*" in nextstatus:
+ tarinactrl_ip = nextstatus.split('*')[1]
+ nextstatus = nextstatus.split('*')[0]
+ print('tarinactrl ip:' + tarinactrl_ip)
process = Process(target=listenforclients, args=("0.0.0.0", port, que))
process.start()
if nextstatus=="REC":
@@ -232,7 +236,8 @@ def main():
elif "SYNCIP:" in nextstatus:
ip = nextstatus.split(':')[1]
stopinterface(camera)
- run_command('rsync -avr --progress --exclude="*.wav" pi@'+ip+':'+filmfolder+filmname+'/'+'scene'+str(scene).zfill(3)+' '+filmfolder+filmname+'/')
+ run_command('rsync -avr --update --progress --exclude="*.wav" pi@'+ip+':'+filmfolder+filmname+'/'+'scene'+str(scene).zfill(3)+' '+filmfolder+filmname+'/')
+ sendtoserver(tarinactrl_ip,port,'SYNCDONE'))
#run_command('scp -r '+filmfolder+filmname+'/'+'scene'+str(scene).zfill(3)+' pi@'+ip+':'+filmfolder+filmname+'/')
startinterface()
camera = startcamera(lens,fps)
@@ -1200,7 +1205,7 @@ def listenforclients(host, port, q):
nextstatus = data
print("got data:"+nextstatus)
c.close()
- q.put(nextstatus)
+ q.put(nextstatus+'*'+addr[0])
break
except:
print("somthin wrong")