TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: DENNIS LEE BIEBER
from: ROBH
date: 2018-06-15 14:47:00
subject: Re: ftp causing invalid s

On 15/06/18 13:32, Dennis Lee Bieber wrote:
> On Fri, 15 Jun 2018 11:30:56 +0100, RobH  declaimed the
> following:
>
>
>> Now the script runs without error, but, even though there was a 4.8mb
>> file created on the PiZero, it was a 0 bytes file copied or moved to to
>> NAS box /mnt/CCTV/PiZero.
>
>  That I can't really help you with -- it could be a timing problem in
> that the camera may still not have flushed the data to the temporary
> location by the time the copy to NAS operation is being invoked (though I'd
> have hoped a small sleep() would give the process time to complete
> flushing).
>
>  The only other option is to disable use of RAM to buffer the capture
> with a later copy to NAS... Instead, capture directly to the NAS. Possibly
> concerns -- network overhead impacting the camera capture process.
>
>  You would do this by (at first, for testing) commenting out the shutil
> and related commands (unlink(), sleep()) and changing the camera capture
> commands from RAMxxx to NASxxx.
>
>

When I commented out shutil and RAMxxx to NAsxxx, the script ran fine
and took a video. When I then removed the comment from shutil and ran
the script again, there was an error:

pi@raspberrypi:~/Downloads $ python intruder.py
Traceback (most recent call last):
   File "intruder.py", line 37, in 
     shutil.copyfile(RAMname, NASname)
   File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
     with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied:
'/mnt/CCTV/PiZero/2018-06-15_14.40.14.h26

This was picked up by the unlink line commented out, or however you
would say it
And a 0 byte file is copied to my NAS /PiZero directory.

Now when I un commented out the unlink line, the script ran without
error, and a video was written to the /mnt/CCTV/Pizero directory on the
PiZero. No file was copied or moved to my NAS box PiZero directory

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.