TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ROBH
from: ROBH
date: 2018-05-22 11:49:00
subject: Re: ftp causing invalid s

On 21/05/18 11:58, RobH wrote:
> On 20/05/18 21:41, Björn Lundin wrote:
>> On 2018-05-20 20:00, RobH wrote:
>>> I did sudo chown pi:pi /mnt/CCTV/PiZero and sudo chown pi:pi /mnt/CCTV
>>>
>>> Then I:
>>> pi@raspberrypi:~ $ sudo mount //192.168.0.22/CCTV/PiZero
>>> /mnt/CCTV/PiZero
>>> Password for root@//192.168.0.22/CCTV/PiZero:  ******
>>> pi@raspberrypi:~ $
>>>
>>> No error messages of any kind now, so in the script you provided, where
>>> or what should I change to incorporate FreeNAS ip address.
>>
>> great.
>> before fiddling with the script try this
>>
>> echo "test" > /mnt/CCTV/PiZero/test.txt
>>
>> check on you nas if you see the file at CCTC/piZero
>> if you do - then try the script
>>
>> if you get permission denied, try
>>
>> sudo echo "test" > /mnt/CCTV/PiZero/test.txt
>>
>> check again.
>>
>> if ok (you see in in the nas)
>> remove the file with
>>
>> sudo rm /mnt/CCTV/PiZero/test.txt
>>
>>
>> fix permissions
>> sudo chown -R pi:pi /mnt/CCTV/PiZero
>>
>> (note '-R' for recursive)
>>
>> and try again
>>
>> echo "test" > /mnt/CCTV/PiZero/test.txt
>> if ok, try the script
>>
>>
>>
>>
>>
>>
>
> Ok , things seem to be getting better here.
>
> pi@raspberrypi:~ $ echo "test" > /mnt/CCTV/PiZero/test.txt
> -bash: /mnt/CCTV/PiZero/test.txt: Permission denied
>
> So:
> pi@raspberrypi:~ $ sudo chown /mnt/CCTV/PiZero.
> chown: missing operand after ‘/mnt/CCTV/PiZero’
> Try 'chown --help' for more information.
>
> pi@raspberrypi:~ $ sudo chown //192.168.0.22/CCTV/PiZero /mnt/CCTV/PiZero
> chown: invalid user: ‘//192.168.0.22/CCTV/PiZero’
>
> I left it for an hour or so, then tried again:
> pi@raspberrypi:~ $ sudo echo "test" > /mnt/CCTV/PiZero/test.txt
> -bash: /mnt/CCTV/PiZero/test.txt: Permission denied
>
> So:
> pi@raspberrypi:~ $ sudo chown -R pi:pi /mnt/CCTV/PiZero
> pi@raspberrypi:~ $ sudo rm /mnt/CCTV/PiZero/test.txt
>
> I then looked on my FreeNAS box , in the CCTV/PiZero directory, and to
> my surprise, I saw files there from yesterday, and also the test.txt file.
>
> The files from yesterday are the ones started by the python script on
> motion detected, BUT, they are all 0 bytes.
>
> So as I say, some improvment.
>

I removed the # from infront of os.unlink, and I'm still getting
permission denied after this:

pi@raspberrypi:~ $ sudo mount //192.168.0.22/CCTV/PiZero
/mnt/CCTV/PiZero -o username=root,password=******

pi@raspberrypi:~ $ python intruder_recmotion.pyTraceback (most recent
call last):
   File "intruder_recmotion.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-050-22_11.34.55.h264'

So I tried:
sudo chown -R pi:pi /mnt/CCTV/PiZero

then:
pi@raspberrypi:~ $ python intruder_recmotion.py
Traceback (most recent call last):
   File "intruder_recmotion.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-050-22_11.44.02.h264'
pi@raspberrypi:~ $

Again, the files are being created, but are all 0 bytes.

Something is just not quite right.

Clutching at straws here, but does the /etc/fsab file need editing with
this:
192.168.0.22/CCTV/PiZero /mnt/CCTV/PiZero -o username=root,password=2Sm4k5


Thanks

--- 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™.