Sharing for Windows network

Hello, I am an absolute newcomer.
Please help me.
How can I share the folder /home/pi/.octoprint/uploads for a Windows LAN network.

Let's back up a step here - why do you want to do this? If it is in order to upload files by placing them inside a shared folder on your windows box, it's not the uploads folder you want to share but rather the watched folder.

OctoPrint does some housekeeping inside the uploads folder which can cause issues if you start messing around with that folder outside of the control of OctoPrint.

For sharing the watched folder, there's a nice video tutorial by Joe Mike Terranella here:

I'd actually recommend the whole series, especially if you are an absolute newcomer.

1 Like

Hallo,

Thanks for the tip. My problem is that no word understands English.
I'd rather have a description. I can translate them to Bing.
Regards
Armin

Hello. You should look for information about configuring samba. It´s not too difficult.

Samba upgrade instructions

Hallo,
I have Samba installed and changed the smb.conf according to the instructions.
The network is fine. Ping from the Windows PC recognizes the RASBPI and vice versa as well. Only the shared RASBPI drive is not displayed on Windows-PC.
What do I need to do to display the RASBPI folder on the Windows PC?

Did you run sudo testparm /etc/samba/smb.confand did it succeed without errors? Did you reboot after that? What does sudo smbstatus --shares on the Raspi indicate?

Please include your smb.conf file so that I can review it.

Also, please run the following command and share the output here: ls -l ~/.octoprint

Hallo OutsourcedGuru,
Thanks for the reply.
'sudo testparm /etc/samba/smb.conf' yielded the following output:
pi@octopi:~ $ sudo testparm /etc/samba/smb.conf
[sudo] Passwort f�r pi:
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Processing section "[RasbPi-LW]"
Loaded services file OK.
ERROR: both 'wins support = true' and 'wins server = ' cannot be set in the smb.conf file. nmbd will abort with this setting.

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

Global parameters

[global]
workgroup = AG1
os level = 255
preferred master = Yes
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
usershare allow guests = Yes
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd chat = Enter\snew\s\spassword:* %n\n Retype\snew\s\spassword:* %n\n password\supdated\ssuccessfully .
passwd program = /usr/bin/passwd %u
security = USER
server role = standalone server
unix password sync = Yes
dns proxy = No
wins server = 192.168.0.2
wins support = Yes
idmap config * : backend = tdb
create mask = 0700
directory mask = 0700
valid users = %S

[RasbPi-LW]
comment = Watched Folder
path = /home/pi/.octoprint/watched
create mask = 0777
directory mask = 0777
guest ok = Yes
read only = No

'sudo smbstatus --shares' yielded the following output:
pi@octopi:~ $ sudo smbstatus --shares

Service pid Machine Connected at Encryption Signing

pi@octopi:~ $

and ls -l ~/.octoprint yielded the following output:
pi@octopi:~ ls -l ~/.octoprint insgesamt 52 -rw-r--r-- 1 pi pi 1470 Aug 15 09:10 config.yaml drwxr-xr-x 5 pi pi 4096 Aug 16 03:49 data drwxr-xr-x 4 pi pi 4096 Aug 16 03:49 generated drwxr-xr-x 2 pi pi 4096 Aug 15 22:55 logs drwxr-xr-x 2 pi pi 4096 Apr 18 03:08 plugins drwxr-xr-x 2 pi pi 4096 Aug 15 09:28 printerProfiles drwxr-xr-x 2 pi pi 4096 Apr 18 03:08 scripts drwxr-xr-x 3 pi pi 4096 Aug 6 16:02 slicingProfiles drwxr-xr-x 3 pi pi 4096 Aug 6 16:02 timelapse drwxr-xr-x 2 pi pi 4096 Apr 18 03:09 translations drwxr-xr-x 2 pi pi 4096 Aug 9 15:51 uploads -rw------- 1 pi pi 252 Aug 7 13:59 users.yaml drwxr-xr-x 2 pi pi 4096 Aug 10 14:53 watched pi@octopi:~

The file has the following content:

[global]

workgroup = AG1
wins support = yes
wins server = 192.168.0.2
dns proxy = no

log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = Enter\snew\s\spassword:* %n\n Retype\snew\s\spassword:* %n\n password\supdated\ssuccessfully .
pam password change = yes
map to guest = bad user

read only = yes
create mask = 0700
directory mask = 0700
valid users = %S

security = user
encrypt passwords = true
os level = 255
preferred master = yes
local master = yes

[RasbPi-LW]
comment = Watched Folder
path = /home/pi/.octoprint/watched
browseable = yes
writeable = yes
read only = no
only guest = no
create mask = 0777
directory mask = 0777
public = yes
guest ok = yes

ls -l ~/.octoprint yielded the following output:
pi@octopi:~
pi@octopi:~ $ ls -l ~/.octoprint
insgesamt 52
-rw-r--r-- 1 pi pi 1470 Aug 15 09:10 config.yaml

drwxr-xr-x 5 pi pi 4096 Aug 16 03:49 data
drwxr-xr-x 4 pi pi 4096 Aug 16 03:49 generated
drwxr-xr-x 2 pi pi 4096 Aug 15 22:55 logs
drwxr-xr-x 2 pi pi 4096 Apr 18 03:08 plugins
drwxr-xr-x 2 pi pi 4096 Aug 15 09:28 printerProfiles
drwxr-xr-x 2 pi pi 4096 Apr 18 03:08 scripts
drwxr-xr-x 3 pi pi 4096 Aug 6 16:02 slicingProfiles
drwxr-xr-x 3 pi pi 4096 Aug 6 16:02 timelapse
drwxr-xr-x 2 pi pi 4096 Apr 18 03:09 translations
drwxr-xr-x 2 pi pi 4096 Aug 9 15:51 uploads
-rw------- 1 pi pi 252 Aug 7 13:59 users.yaml
drwxr-xr-x 2 pi pi 4096 Aug 10 14:53 watched
pi@octopi:~ $

It's saying that you need to fix this problem for the smb.conf to be used.

We need the actual response rather than just the command you entered. Otherwise, you have no shares and this is the problem. But see the first suggestion since smb couldn't happily parse your config file.

drwxr-xr-x 2 pi pi 4096 Aug 9 15:51 uploads
drwxr-xr-x 2 pi pi 4096 Aug 10 14:53 watched

It looks like your watched folder has rights at the UNIX level to at least allow someone to connect to a share. I'm wondering why you're trying to share that folder and not uploads instead.

Because that is the recommended way since sharing and fiddling around with the uploads folder is a really bad idea considering that it should be exclusively handled by OctoPrint due to various book keeping stuff it does in there.

I wonder if a symlink in uploads over to watched would help in a situation link this.

I have corrected the error :ERROR: both 'wins support = true' and 'wins server = ' cannot be set in the smb.conf file. nmbd will abort with this setting.
'sudo testparm /etc/samba/smb.conf' - Does not bring an error message
restart
'sudo smbstatus --shares' - Empty table with this table header
'Service pid Machine Connected at Encryption Signing'

That smbstatus command should show you the share(s) if everything is setup correctly.

You might try looking for other tutorials to see if you can get this to work better.

Hello
All previous attempts were unsuccessful. Now I have tried with Raspbian Jessie these samba settings and it worked.
The shared Raspbian folder was visible and responsive under Windows. Under Raspbian is the static IP 192.168.0.5.
Under Octopi is the IP 169.254.87.72. What is this IP for, can I change it? I suspect that the missing release of the Octopi folder is related to this IP.
If I can change this IP, where should I do it?

The 169.254.x.x space is a private network which is reserved for all Ethernet/wi-fi adapters which fail to receive a DHCP client request. On a MacBook, for example, it's the range of addresses that will bind to your Ethernet connection if you use a loopback cable over to a Raspberry Pi, for example.

I know that on the Robo 3D printer's fork of OctoPi, there was a wi-fi hotspot mode and it would bind to that network. I'm not sure if OctoPrint has that as well hidden somewhere in its interface but I assume not.

Ah... if you've told Samba that it should be a DHCP Server on the DNS side of things, then it might do this. Make sure that you're not trying to spin up a DHCP server in your config file.

How can I change the IP address 169.254.87.72 to 192.168.0.50?
I've tried it with /etc/network/interfaces.d/interfaces, but it doesn't change anything.

Raspbian before the Stretch version did use the technique you're describing to make an IP address static. Now, with this major version you'll want to instead edit the /etc/wpa_supplicant/wpa_supplicant.conf file, having remoted in. (Raspbian now uses wpa_supplicant as the underlying service.)

If I understand this correctly, wpa_supplicant is for WLAN, but I run a LAN with statc IP

Wi-fi is the wireless connection; otherwise, it's the Ethernet (RJ-45) physical connection. If you connect to your network with wireless, then proceed as I've described.


If instead, you directly connect an Ethernet cable, then read through this long post about exactly how to do it right. Remember that you're on the Stretch version of Raspian now versus earlier ones (everything has changed). Having read that, go specifically to the "Setup a Static IP Address" part. Like the post in the link suggests: there are many posts which give the wrong advice. You'd want to use the "dhcpcd method" for setting a static IP address on your Ethernet adapter.