I setup MotionEye on a Raspberry Pi 4b. I noticed it doesn’t have any option to store files on a SMB server. I thought that maybe I have to setup the SMB server connection first before it will show up. I see guides on how to make a SMB server but not how to connect to a SMB server. Is connecting to a SMB server for use with MotionEye possible on DietPi?
edit:
Apparently, when you use dietpi-software in terminal and search for Samba. You don’t just get Samba Server as an option. You also get the software to connect to Samba Servers. They are seperate pieces of software.
edit2:
I setup a SMB client and I can successfully access the folder in terminal. When I try to save to this SMB directory with MotionEye, nothing happens.
I used this guide. https://www.youtube.com/watch?v=8QxJWW0mjAs&pp=ygURc21iIGNsaWVudCBkaWV0cGk%3D
You should revert all steps done and simply use our drive manager to connect to a samba share.
I tried that and the same thing is happening. It is not saving to the network drive but when I log in as root, it can see all the files on the network drive.
I also noticed something else. When I change the camera from 640x480 to 1600x1200 and try to save a picture, it crashes the video feed in MotionEye. I have to refresh the url to see a video feed again. It doesn’t do that when I have it set to 640x480
You would need to check permissions on the mount point you connected your Samba share to. Probably MotionEye is not able to write into this directory due to missing permissions.
I tried:
chmod 666 *folder name*
I tried saving both in an internal folder and folder name itself. It is still not saving the pictures. Other devices can save just fine in the same network folder.
I am not sure what the problem is or how I can solve this.
you would need to share some logs and/or an error message at least. In addition you could contact the MotionEye project asking for support
Looking at the logs, it seems like it is getting a permission denied when it is trying to make the day folder. I also see a later error talking about unable to make symbolic link. I am wondering why it is trying to make a symbolic link at all. It should just be creating a folder and saving a picture. The network drive doesn’t support symbolic links.
If I understand it correctly, applications installed through dietpi software manager are ran as root. Why would there be an issue with creating a folder? Even if the permission issues were coming from the network drive, I tested that by creating a folder from a computer on the same network. I found no issues.
Not quite correct. There are a number of applications that run under their own user. Like Motioneye, which runs under its own user ‘motion’.
In addition, Samba does not actually support Unix authorizations. Therefore we mount a Samba share with the group authorization dietpi
. This means that only users in this group can write to the Samba share.
You can test this yourself as follows
sudo -u motion touch /mnt/samba/test.text
Replace /mnt/samba/
with your Samba mount point.
You should get following
root@DietPi5:/mnt/samba# sudo -u motion touch /mnt/samba/test.text
touch: cannot touch '/mnt/samba/test.text': Permission denied
As a workaround you can add the user motion
to the group dietpi
.
usermod -a -G dietpi motion
An now, it should be working to write files as user motion
to the Samba share
root@DietPi5:/mnt/samba# sudo -u motion touch /mnt/samba/test.text
root@DietPi5:/mnt/samba# ls -la /mnt/samba/test.text
-rwxrwx--- 1 root dietpi 0 Jun 27 19:14 /mnt/samba/test.text
root@DietPi5:/mnt/samba#