COMPLETE Setting up SAMBA on the Raspberry Pi to make file transfers simple

Discussion in 'Guides, Mods, and Upgrades' started by jfb, Jul 16, 2016.

  1. jfb

    jfb Well-Known Member

    Joined:
    Mar 30, 2016
    Messages:
    169
    Likes Received:
    35
    This is a very simple guide to setting up a samba server on your Raspberry Pi to make file transfers to and from the Pi simple
    Please note: This is NOT a particularly secure setup, so either look up how to secure it, or ensure it's behind a firewall (or preferably both)

    In simple terms, Log onto the Pi, install the software and configure it

    • Log onto the Pi using PUTTY or whatever your favourite method is
    • Install the software
    sudo apt-get install samba samba-common-bin
    • Edit the config file - This is a large file, mostly consisting of comments
    sudo nano /etc/samba/smb.conf
    • Paste the following in just above [printers]
    [uploads]
    comment = OctoPrint Uploads
    path = /home/pi/.octoprint/uploads
    writeable = Yes
    only guest = Yes
    create mask = 0777
    directory mask = 0777
    browseable = Yes
    public = yes

    [watched]
    comment = OctoPrint Watched Folder
    path = /home/pi/.octoprint/watched
    writeable = Yes
    only guest = Yes
    create mask = 0777
    directory mask = 0777
    browseable = Yes
    public = yes

    [timelapse]
    comment = OctoPrint Time Lapses
    path = /home/pi/.octoprint/timelapse
    writeable = Yes
    only guest = Yes
    create mask = 0777
    directory mask = 0777
    browseable = Yes
    public = yes

    [octoprint]
    comment = OctoPrint Main
    path = /home/pi/.octoprint
    writeable = Yes
    only guest = Yes
    create mask = 0777
    directory mask = 0777
    browseable = Yes
    public = yes
    • Save & exit nano (Ctrl-O, Return, Ctrl-X)
    • Add the pi user to the smb password list
    sudo smbpasswd -a pi
    • Make sure the uploads folder is writable (it probably is, but this won't hurt)
    sudo chmod 777 /home/pi/.octoprint/uploads
    • Reboot
    sudo reboot now

    Once rebooted, in windows explorer (or whatever) go to \\octopi.local (or //octopi.local in other OS')
    you should see the folders defined above (uploads, watched, timelapse, octoprint)
    By default, these are probably read only, so you may need to use chmod to make them writeable (eg sudo chmod 777 /home/pi/.octoprint/uploads)
    Regardless of the permissions on the folders, individual file permissions will affect what you can do with a file.

    Hope that's useful
     
    MintyBiglyPrints likes this.

Share This Page