Connecting a PC
Warning
This is a fast moving field. This information will be out of date in some detail even before you read it.
Yes, I know there are lots of home automation things to do but let's hook the
Pi to the desktop because that makes everything 100 times easier and there will
be enough to grey your hair and test your sanity without making editing and
backing up files a problem.
My first attempt was to use cifs-utils but it was a total pain so I went
with samba.
I read https://raspberrypihq.com/how-to-share-a-folder-with-a-windows-computer-from-a-raspberry-pi/
and this is what I extracted:
sudo apt-get install samba samba-common-bin
sudo nano /etc/samba/smb.conf (to edit the configuration)
workgroup = WORKGROUP (check this although it was already set)
wins support = yes (but this wasn't)
#[Homes] (comment the whole [Homes] section out)
# comment...... (etc)
[Transfer] (then append these at the end)
comment=Shared folder with PC
path=/home/pi
browseable=Yes
writeable=Yes
only guest=no
create mask=0777
directory mask=0777
public=no
[homeassistant]
comment=Shared folder to PC
path=/home/homeassistant/.homeassistant
browseable=Yes
writeable=Yes
only guest=no
create mask=0777
directory mask=0777
public=no
save that file then we're going to establish an id that you can use to log onto the Pi from the PC
sudo smbpasswd -a pi (set a password for a user called pi logging on from the pc)
<redacted>
<redacted> (add a new password to the post-it)
At which point refreshing the PC's Network page showed raspberrypi with folders
homeassistant and Transfer under it. I logged in as user pi with the password I
had selected and copied some files over and it worked. Then I rebooted the pi
and it all worked (if you wait). Don't forget to use chmod 0777 filename
on things you want to grant full read/write access to.
Of course the next day it wasn't working. I couldn't find it unless I entered
the name \\raspberrypi manually so I dragged the links to put shortcuts
on the PC desktop so I don't care. Now configuration.yaml is within easy reach
of my favourite text editor and, more importantly, I can copy, stick and rename
files to keep an 'off pi' backup of dated configuration.yaml files so I can
back-track when I inevitably break something which is, sadly, all to
often.
I modified the stuff in configuration.yaml for my location et al and saved it
on my PC as my first backup configuration.2018.01.08.21.45yaml
I can see me ending up with a lot of these...
Time for another cup of tea.
by Nigel Hewitt