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.
Basically
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
sudo /etc/init.d/hostname.sh
sudo reboot
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.
DD-WRT offers another solution for this problem without installation of any software to RPi.
Detailed description of router configuration can be found at
http://www.howtogeek.com/69696/how-to-access-your-machines-using-dns-names-with-dd-wrt/
Not sure what the problem is with adding software to RPI – you have to add software to make it work anyway…. use by name works well but of course you can do in router – if you’re happy playing with router of course. Most of my boards I can now call by name – except the ESP8266 units – but then I talk to them by name using MQTT so it’s not really important what their address is…