This brief article should help Raspberry Pi users who like me are merely dabbling in Linux but generally use Windows machines.
Sick of accessing your Raspberry Pi (or Pis) by IP address? Here’s a solution.
I’ve used Samba before with mixed success. I don’t even want to access Pi files on the PC – I just want the damned Pi to show up.
So I discovered this blog entry from Arc Software and in it a variation I’d not seen before of Samba install on Pi.
sudo apt-get install samba samba-common samba-common-bin winbind
The bit at the end was new to me. It makes sure the Pi announces itself to Windows.
That’s it, that’s all I had to do and all of a sudden, “raspberrypi” was added to my list of machines in Windows file explorer. Neat. Of course that’s fine if you have one Pi but I have more than one you’ll want to change the name. You can do that via Raspi-update but also this way… in each of the first two lines change raspberrypi to whatever you want then control_O to write out and control_X to exit nano editor.
sudo nano /etc/hosts - change 127.0.0.1 entry
sudo nano /etc/hostname - only one entry in there - change
I’m not even sure what the hostname script does but I followed instructions in another blog to get this far – and then the’re the reboot. My Pi is now called “bedrock” and that just all works a treat… so now I can access Node-Red as bedrock:1880 etc.
A catch for Node-Red users: BEWARE – renaming your Pi if you are using Node-Red will end up giving you a clean new Node-Red with no flows in it. In my case, my flows are stored in /home/pi/.node-red.
I had two files – flows_raspberrypi.json and flows_raspberrypi_cred.json - after giving the Pi a new name, I simply stopped Node-Red, renamed the two files to flows_bedrock.json and flows_bedrock_cred.json and restarted Node-Red – all was well!!
If you DO want to access Pi files from the PC – that link near the top of the article goes into a more detail.