On Fri, 18 May 2018 20:39:42 +0100, RobH declaimed the following:
That did not say to save the /script/ in that directory, which is what you stated you were trying to do -- it said to edit the script so that /mnt/CCTV/PiZero is where the script is going to save files it creates.
And that is NOT what you were told to put there. You still have that double / at the start, which is telling the OS to look for a remote computer named "mnt" and look for a directory named "CCTV" on it.
That was an example on MY RPI3, from in my default "pi" login. I already had a Public directory there, and this Public directory is empty. As I showed in the lines prior to that. (copied below)
This is why you've been asked to cut&paste the actual lines from the console window, not hand-type what you think is a copy. Using the actual console window lines shown above one can deduce:
pi@raspberypi one is logged into the account "pi" on machine "raspberrypi"
:~ one is in the account home directory
"mkdir" default behavior is to only create the last name in the path, and expects to find all prior path components alread exist (and are directories).
As for the script itself...
Since I believe you are working from the script prototype I provided, that means changing:
NASname = os.path.join("/path/to/NAS/mount/point", fname)
to
NASname = os.path.join("/mnt/CCTV/PiZero", fname)
Do NOT add any extra / characters, do not try to reference any remote machine -- when the script is running, it expects to find that path exists in the local file system. In fact, in the absence of a working "mount", running the script should result in files being saved in /mnt/CCTV/PiZero ON THE RPI -- that would verify the functionality of the script. If the script is saving to /mnt/CCTV/PiZero the only remaining action is to use the command line "mount" command to map the NAS to /mnt/CCTV/PiZero, where it replaces the local directory.
That should be the only change the script needs (unless you want to remove the short-term use of RAM for buffering the capture, and capture directly to the NAS... In that case you'd remove the RAMname = os... line, remove the copyfile() and unlink() lines, and change the start_recording() to use NASname; I suggest keeping the RAM buffer so that network hiccups don't interfere with the capture itself).