My yard light won't go off any more. I block the detector wait 60 seconds...
B
Björn Lundin
hmm, not sure here, you seem to be able to *create* a file but not write to that same file
what does la -la /CCTV/PiZero on the *NAS* show.
--
R
RobH
Yes I have already done that after I realised what I did
R
RobH
[root@freenas ~]# la -la /CCTV/PiZero
bash: la: command not found
[root@freenas ~]# ls -la /CCTV/PiZero
ls: /CCTV/PiZero: No such file or directory
[root@freenas ~]#
The directory is there as I can see it in the Storage menu
As I posted earlier, does something need to be entered on the /etc/fsab file somewhere.
D
Dennis Lee Bieber
On Tue, 22 May 2018 20:25:52 +0100, RobH declaimed the following:
Must be a mistake in the datetime formatting.. "050" should just be "05". But I don't see it in my prototype...
And those duplicated the day in the month position.
Out of curiousity -- with the .unlink() commented out -- what size do the files show in /dev/shm?
I'm wondering if the camera library isn't flushing/closing the capture file before the copy to NAS is done...
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
B
Björn Lundin
Yes, it is usually somewhere in /shares or /Shares or another top directory.
so what you see as /CCTV/PiZero in a menu is really /shares/CCTV/PiZero or something similar -perhaps /mnt/CCTV/PiZero or /media/CCTV/PiZero
no - not on nas on pi - if you want the mount automatically at boot. but if you bork that file up - you may end up with an unbootable system. It is fixable from another linuxbox but tricky if you are on a newbie level.
To rule out errors in script : manually put a file in the pi directory, as I said upthread. the part with echo "test" > /mnt/CCTV/PiZero/test.txt or sudo echo "test" > /mnt/CCTV/PiZero/test.txt
ls -la /mnt/CCTV/PiZero then and post here
--
R
RobH
-bash: /mnt/CCTV/PiZero/test.txt: Permission denied pi@raspberrypi:~ $ sudo chown -R pi:pi /mnt/CCTV/PiZero pi@raspberrypi:~ $ sudo echo "test" > /mnt/CCTV/PiZero/test.txt pi@raspberrypi:~ $ ls -la /mnt/CCTV/PiZero total 11 drwxr-xrwx 2 pi pi 0 May 23 09:28 . drwxr-xr-x 3 pi pi 4096 May 17 17:36 ..
-rw-r--r-- 1 pi pi 0 May 21 11:50 2018-050-21_11.50.09.h264
-rw-r--r-- 1 pi pi 0 May 22 09:46 2018-050-22_09.46.39.h264
-rw-r--r-- 1 pi pi 0 May 22 09:51 2018-050-22_09.51.12.h264
-rw-r--r-- 1 pi pi 0 May 22 11:35 2018-050-22_11.34.55.h264
-rw-r--r-- 1 pi pi 0 May 22 11:44 2018-050-22_11.44.02.h264
-rw-r--r-- 1 pi pi 0 May 22 11:46 2018-050-22_11.46.02.h264
-rw-r--r-- 1 pi pi 0 May 19 17:31 2018-19-19_17.31.32.h264
-rw-r--r-- 1 pi pi 0 May 19 17:40 2018-19-19_17.40.13.h264
-rw-r--r-- 1 pi pi 0 May 19 17:43 2018-19-19_17.43.42.h264
-rw-r--r-- 1 pi pi 0 May 20 19:02 2018-20-20_19.01.50.h264
-rw-r--r-- 1 pi pi 0 May 20 19:08 2018-20-20_19.08.38.h264
-rw-r--r-- 1 pi pi 0 May 20 20:02 2018-20-20_20.02.21.h264
-rw-r--r-- 1 pi pi 0 May 20 20:51 2018-20-20_20.51.49.h264
-rw-r--r-- 1 pi pi 5 May 23 09:28 test.txt pi@raspberrypi:~ $
As you can see, I had to give permissions again for the 'echo test' command to run.
pi@raspberrypi:~ $ ls -la /mnt/CCTV/PiZero total 11 drwxr-xrwx 2 pi pi 0 May 23 09:28 . drwxr-xr-x 3 pi pi 4096 May 17 17:36 ..
-rw-r--r-- 1 pi pi 0 May 21 11:50 2018-050-21_11.50.09.h264
-rw-r--r-- 1 pi pi 0 May 22 09:46 2018-050-22_09.46.39.h264
-rw-r--r-- 1 pi pi 0 May 22 09:51 2018-050-22_09.51.12.h264
-rw-r--r-- 1 pi pi 0 May 22 11:35 2018-050-22_11.34.55.h264
-rw-r--r-- 1 pi pi 0 May 22 11:44 2018-050-22_11.44.02.h264
-rw-r--r-- 1 pi pi 0 May 22 11:46 2018-050-22_11.46.02.h264
-rw-r--r-- 1 pi pi 0 May 19 17:31 2018-19-19_17.31.32.h264
-rw-r--r-- 1 pi pi 0 May 19 17:40 2018-19-19_17.40.13.h264
-rw-r--r-- 1 pi pi 0 May 19 17:43 2018-19-19_17.43.42.h264
-rw-r--r-- 1 pi pi 0 May 20 19:02 2018-20-20_19.01.50.h264
-rw-r--r-- 1 pi pi 0 May 20 19:08 2018-20-20_19.08.38.h264
-rw-r--r-- 1 pi pi 0 May 20 20:02 2018-20-20_20.02.21.h264
-rw-r--r-- 1 pi pi 0 May 20 20:51 2018-20-20_20.51.49.h264
-rw-r--r-- 1 pi pi 5 May 23 09:28 test.txt pi@raspberrypi:~ $
I've just realised that FreeNAS resides on a 16gb SSD drive and all the storage drives are listed or mounted by FreeNAS, and the data on them is managed by FreeNAS, if that sounds right.
This is the Freenas system:
[root@freenas ~]# ls
.bash_history .gdbinit .login .ssh
.bashrc .history .profile secrets.tdb
.cshrc .k5login .shrc
[root@freenas ~]#
R
RobH
With .unlink commented out the files on the PiZero /dev/shm are all about 2.8mb in size, from file/properties, and yet when I:
pi@raspberrypi:~ $ ls -la /mnt/CCTV/PiZero total 12 drwxr-xrwx 2 pi pi 0 May 23 09:47 . drwxr-xr-x 3 pi pi 4096 May 17 17:36 ..
-rw-r--r-- 1 pi pi 0 May 21 11:50 2018-050-21_11.50.09.h264
-rw-r--r-- 1 pi pi 0 May 22 09:46 2018-050-22_09.46.39.h264
-rw-r--r-- 1 pi pi 0 May 22 09:51 2018-050-22_09.51.12.h264
-rw-r--r-- 1 pi pi 0 May 22 11:35 2018-050-22_11.34.55.h264
-rw-r--r-- 1 pi pi 0 May 22 11:44 2018-050-22_11.44.02.h264
-rw-r--r-- 1 pi pi 0 May 22 11:46 2018-050-22_11.46.02.h264
-rw-r--r-- 1 root pi 0 May 23 09:47 2018-050-23_09.47.38.h264
-rw-r--r-- 1 pi pi 0 May 19 17:31 2018-19-19_17.31.32.h264
-rw-r--r-- 1 pi pi 0 May 19 17:40 2018-19-19_17.40.13.h264
-rw-r--r-- 1 pi pi 0 May 19 17:43 2018-19-19_17.43.42.h264
-rw-r--r-- 1 pi pi 0 May 20 19:02 2018-20-20_19.01.50.h264
-rw-r--r-- 1 pi pi 0 May 20 19:08 2018-20-20_19.08.38.h264
-rw-r--r-- 1 pi pi 0 May 20 20:02 2018-20-20_20.02.21.h264
-rw-r--r-- 1 pi pi 0 May 20 20:51 2018-20-20_20.51.49.h264
And now they are 0 bytes in size?????
B
Björn Lundin
There you go. You got a file of 5 bytes ('test' + LF)
if you see that file and it contents from the nas, you are almost there.
mount (in this case) is about seeing another filesystem. And that yuu do. Why the videos are 0 byte is likely in the script then. (perhaps as someone else suspected - camera not flushing to disk)
--
R
RobH
Yes the test.txt file I see on my FreeNAS /CCTV/PiZero directory is indeed 5 bytes in size.
It does look like there is something in the python script which is causing the video files to be only 0 bytes on my FreeNAS /PiZero directory.
Thanks
D
druck
And you might want to make it significantly more complex, 5 upper case letters could be cracked in seconds. I also don't use root, create a user account with access to only the directories on the NAS that are needed.
Even if you have your local network firewalled off from the internet, if you accidentially run malware such ransomware on your PC, it may well be able to crack such an obvious username and password on the NAS, and scramble all the files.
---druck
M
Mike
That was *my* edit to remove the original password, rather than repost it AGAIN.
--------------------------------------+------------------------------------
Mike Brown: mjb[-at-]signal11.org.uk | http://www.signal11.org.uk
R
Richard Kettlewell
Waste of time. Once it?s out, it?s out.
https://www.greenend.org.uk/rjk/
I
I R A Darth Aggie
The internet never forgets. Barn, door, horses, some assembly required.
Consulting Minister for Consultants, DNRC
I can please only one person per day. Today is not your day. Tomorrow
isn't looking good, either.
I am BOFH. Resistance is futile. Your network will be assimilated.
A
Axel Berger
Yes. but it's also far too big for everybody to find everthing. A little editing to make it that bit more difficult for the miscreants is a good thing and I applaud it.
/ \ Mail | -- No unannounced, large, binary attachments, please! --
M
Mike
Netiquette ...
Or as someone said up-thread, "waste of time" :)
--------------------------------------+------------------------------------
Mike Brown: mjb[-at-]signal11.org.uk | http://www.signal11.org.uk
B
Björn Lundin
what is the size when you do the move manually? that is mv /dev/shm/file_of_size_greater_than_zero /mnt/CCTV/PiZero/ ls -la /mnt/CCTV/PiZero/file_of_size_greater_than_zero
--
K
Kees van Eeten
Hello RobH!
04 Jun 18 17:53, you wrote to Andy Burns:
Ro> sudo mount -t cifs -o //192.168.0.22/CCTV/PiZero /mnt/CCTV/PiZero Ro> mount: can't find /mnt/CCTV/PiZero in /etc/fstab Ro> pi@raspberrypi:~ $
You cannot use the -o option without a parameter. So either add a parameter or leave it out.
Kees
K
Kees van Eeten
Hello RobH!
04 Jun 18 17:53, you wrote to Andy Burns:
Ro> That returns this:
Ro> sudo mount -t cifs -o //192.168.0.22/CCTV/PiZero /mnt/CCTV/PiZero Ro> mount: can't find /mnt/CCTV/PiZero in /etc/fstab Ro> pi@raspberrypi:~ $
In addition to my other reply:
mount expects a source device and a mount point, if one or the other is missing, mount consults the /etc/fstab for the missing value.
In the above example the sorce device follows -o and is thus seen as the paramater to -o wich should be aan option. As now the source device is missing the mountpoint is looked up in /etc/fstab to find the missing source device.
So remove the -o and let mount apply the defaults. If the defaults are not sufficient, put de needed values behind the -o
Kees
R
RobH
Apologies for late reply, as I did not realise you had replied to me.
I had a problem with the piZero booting as it said the shell is locked, so I just re burned the stretch image on the sd card and starting over again.
As before I have managed to get this far:
I ran this: echo "test" > /mnt/CCTV/PiZero/test.txt and the file was created on my NAS box in the PiZero directory
sudo mount //192.168.0.22/CCTV/PiZero /mnt/CCTV/PiZero -o username=root,password=*******
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 2] No such file or directory: '//192.168.0.22/mnt/CCTV/PiZero/2018-06-04_15.09.19.h264'
On the PiZero I have: /mnt/CCTV/PiZero
When I run this: sudo mount -t cifs -o //192.168.0.22/mnt/CCTV/PiZero /mnt/CCTV/PiZero mount: can't find /mnt/CCTV/PiZero in /etc/fstab
Now as far as I am aware, there was nothing about fstab before, so do you think I should add the said line in /etc/fstab.
Thanks
Now no files of any size are created when I run the python script.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.