Using a NAS Samba Share as output_path

Tips on configuring the Retro-Printer for different applications / equipment
Post Reply
Jonas
Posts: 4
Joined: Sat Oct 21, 2023 1:45 pm

Using a NAS Samba Share as output_path

Post by Jonas »

Hey together,

First of all: I'm a huge fan of this project!

I have one issue I was not able to solve on my own. And I did research for days now. So I hope, you can help.
I'm using a RaspberryPi 3.

With use of "/etc/fstab" I mounted a Directory of my NAS. Everything does work fine, and after boot its perfectly mounted in "/mnt". Also "pi" does have all rights.
But when i configure "output_path" to use this folder, it doesn't work. It stays empty after boot and no folders like "PDF" etc. appear.
When I umount the NAS, there is a folder in /mnt that has the name of the folder I wrote in "output_path", locally on the rasp, filled with "PDF" and the other folders. But the system does not write them onto the shared samba-folder.

Example:

fstab:
//192.168.XXX.XX/Downloads /mnt/Downloads cifs noperm,uid=pi,gid=users,file_mode=0775,dir_mode=0775,nounix,credentials=/.smbcredentials 0 0

outpout_path:
/mnt/Downloads/retroprinter

-> the folder retroprinter keeps beeing empty

-> after "umount /mnt/Downloads"

-> there is a local folder "retroprinter" that contains folders like "PDF" etc.

Can anyone help?

Thanks a lot!
RWAP
Site Admin
Posts: 405
Joined: Wed Sep 13, 2017 9:20 pm
Location: Oswestry, Shropshire
Contact:

Re: Using a NAS Samba Share as output_path

Post by RWAP »

I have no experience of doing this - I have tried to get the Pi to write to a Windows based machine, but it lacks the security protocols required by Windows.

I wonder if it might be something similar (although NAS drives use their own operating system) - can you connect to the NAS drive from the Pi and copy to the folder from the command console? That would be the first step.
Retro-Printer Specialists
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module

Also Involved in:
Icephorm
RWAP
Site Admin
Posts: 405
Joined: Wed Sep 13, 2017 9:20 pm
Location: Oswestry, Shropshire
Contact:

Re: Using a NAS Samba Share as output_path

Post by RWAP »

Retro-Printer Specialists
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module

Also Involved in:
Icephorm
Jonas
Posts: 4
Joined: Sat Oct 21, 2023 1:45 pm

Re: Using a NAS Samba Share as output_path

Post by Jonas »

RWAP wrote: Sat Oct 21, 2023 7:20 pm I have no experience of doing this - I have tried to get the Pi to write to a Windows based machine, but it lacks the security protocols required by Windows.

I wonder if it might be something similar (although NAS drives use their own operating system) - can you connect to the NAS drive from the Pi and copy to the folder from the command console? That would be the first step.
Hey,

yes copying from the console does work perfectly, no problems there. The NAS-Server is a Synology-NAS, so basically a Debian-Server. Another Pi also uses shares from this NAS and it works perfect to. So it does with the retroprinter so far, as long as I do anything "manually" on the console, but as soon as I use the "output_path"-file to use this folder the described problem appears.

Thank you so far!
Jonas
Posts: 4
Joined: Sat Oct 21, 2023 1:45 pm

Re: Using a NAS Samba Share as output_path

Post by Jonas »

RWAP wrote: Sat Oct 21, 2023 7:38 pm Also have a look at:
https://askubuntu.com/questions/923385/ ... g-terminal
Hey,

thanks. But that's exactly what I did. The drive is permanently mounted by using fstab. And as mentioned it does work perfectly as long as I work on it "manually". The problem only appears as far as I use the "output_path"-file.

Thank you!
Last edited by Jonas on Sun Oct 22, 2023 6:40 am, edited 1 time in total.
RWAP
Site Admin
Posts: 405
Joined: Wed Sep 13, 2017 9:20 pm
Location: Oswestry, Shropshire
Contact:

Re: Using a NAS Samba Share as output_path

Post by RWAP »

I have a similar Synology Drive and have just tried this and it works.

NAS Drive Setup
I have created a folder in the homes directory on the NAS drive called RetroPrinter
I created a User on the NAS drive called RetroPrinter, with a password, and read-write access to the /homes directory
NAS User Groups.png
NAS User Groups.png (13.2 KiB) Viewed 1855 times
NAS User Permissions.png
NAS User Permissions.png (21.74 KiB) Viewed 1855 times
Retro-Printer Setup
Create a new credentials file :

Code: Select all

nano ~/.smbcredentials
containing:

Code: Select all

username=RetroPrinter
password=xxxxx
domain=WORKGROUP
Save and then

Code: Select all

chmod 0600 ~/.smbcredentials

Add the following line to /etc/fstab:

Code: Select all

//192.168.1.114/homes/RetroPrinter /home/pi/retroprinter cifs credentials=/root/.smbcredentials,x-systemd.automount,iocharset=utf8,rw,vers=2.1 0 0
I created a new folder on the Retro-Printer and mounted it:

Code: Select all

mkdir /home/pi/retroprinter
mount /home/pi/retroprinter
Then set the /root/config/output_path to

Code: Select all

/home/pi/retroprinter
service retroprinter restart

Creates all of the expected files on the NAS drive
Retro-Printer Specialists
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module

Also Involved in:
Icephorm
Jonas
Posts: 4
Joined: Sat Oct 21, 2023 1:45 pm

Re: Using a NAS Samba Share as output_path

Post by Jonas »

Thank you sooo much!

You can't believe how long I'm dealing with this! I'm so glad right now.
Do you know, what was the only thing I had to change?

-> I added "x-systemd.automount" to fstab and suddenly it worked. <-

Such a simple line...
And what a coincidence that you have the a Synology-NAS as well. And thank you very much for the effortful response and the pictures. If ever someone else is dealing with this, now there is a complete manual.

Thank you and have a very nice day!
Post Reply