I found O'Reilly "Running Linux" was a very good introduction for a computer-literate newbie, but that was 2nd Edition - I have no idea what the new one is like. O'Reilly does a pile of other good stuff such as "Learning the bash Shell" for in-depth coverage and "Linux in a Nutshell" when you know the background and just need the syntax etc. details.
On Sat, 16 Jun 2018 14:58:13 +0100, RobH declaimed the following:
If you are seeing files on the RPi, in /mnt/CCTV/PiZero, but are not seeing them on the NAS itself, the only conclusion I can draw is the NAS is NOT MOUNTED at /mnt/CCTV/PiZero
What does
df -a
report?
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
No, as I rebooted the PiZero and forgot I had to remount it again. There are 0 byte files on the NAS box bot no files on the Pizero machine. So to me it is like that the line
camera.start_recording(NASname)
is doing its job partly, and not writing to the sd card first. df -a //192.168.0.22/CCTV/PiZero/ 942639428 3187324 939452104 1% /mnt/CCTV/PiZero
On Sat, 16 Jun 2018 15:23:25 +0100, RobH declaimed the following:
Which is the same permission error that the shutil.copyfile() was producing. This tells me that there is nothing wrong with the script itself. The problem appears to be on the NAS side -- since it IS accepting operations that provide a file name, but then refuses to accept the actual file data.
Restore the script to the version using RAMname for the capture, and with the .copyfile() back in place. When it dies do the following and cut&paste the results into a message:
ls -l /run/shm
cp /run/shm/*.h264 /mnt/CCTV/PiZero
rm -f /run/shm/*.h264
{Note: the last line is going to clean out old files from /run/shm -- cp & rm together produce the effect of
mv -f /run/shm/*.h264 /mnt/CCTV/PiZero }
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
On Sat, 16 Jun 2018 16:32:51 +0100, RobH declaimed the following:
The whole purpose of this exercise was to STOP writing to the SD card at all.
The version of the script using RAMname for the capture is supposed to store the file IN RAM, and then use copyfile() to move it from RAM to the NAS (followed by .unlink() to delete the copy left in RAM).
With the capture specified as NASname, the file should never be on the RPi physically (not in RAM, not in SD card), but is supposed to go directly to the NAS.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
DESCRIPTION The id utility displays the user and group names and numeric IDs, of the calling process, to the standard output. If the real and effective IDs are different, both are displayed, otherwise only the real ID is displayed.
Ok, I was getting permission denied with everything on the /mnt/CCTV/PiZero folder.
I removed all the existing files from the PiZero /mnt/CCTV/Pizero folder as they were all write protected, and had to reboot for the folder to show 0 files.
When I do ls -l I get total 4 drwxrwxrwxrwx 2 pi:pi 4096 June 24 18.47 PiZero
Then because of a reboot, I have to: pi@raspberrypi:~ $ sudo mount -t cifs -o username=root,password=2Sm4k5 //192.168.0.22/CCTV/PiZero/ /mnt/CCTV/PiZero
And now:
pi@raspberrypi:/mnt/CCTV $ ls -l total 0 drwxrwxr-x 2 root nogroup 0 Jun 24 18:55 PiZero
When I try to remove it: pi@raspberrypi:/mnt/CCTV $ sudo rm -r PiZero rm: cannot remove 'PiZero': Device or resource busy pi@raspberrypi:/mnt/CCTV $
So for some reason as soon as the PIZero directory is mounted, it becomes owned by root, as above with sudo mount.
If I remove -o I get:
pi@raspberrypi:~ $ mount -t cifs -o username=root,password=2Sm4k5 //192.168.0.22/CCTV/PiZero/ /mnt/CCTV/PiZero mount: only root can use "--options" option pi@raspberrypi:~ $ mount -t cifs username=root,password=2Sm4k5 //192.168.0.22/CCTV/PiZero/ /mnt/CCTV/PiZero mount: only root can use "--types" option
Now I am between the devil and the deep blue sea
Before I mount the PiZero directory it is owned by pi:pi, but after I mount the PiZero directory it is owned by root
I have also tried echo "hello" > /mnt/CCTV/test.txt , but nothing is created on the said directory, although the file is created on the actual PiZero CCTV directory
pi@raspberrypi:~ $ cd /mnt/CCTV pi@raspberrypi:/mnt/CCTV $ ls PiZero test.txt pi@raspberrypi:/mnt/CCTV $
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.