Get Your Turtlebot on mDNS with a .local Address

I have a turtlebot here at work.

I am sick and tired of sshing into randomly assigned IP addresses. Luckily, there’s something called mDNS which allows you to reserve a hostname.local for your turtlebot. Instead of sshing to something like:

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

ssh turtlebot@10.20.1.113

[/pastacode]

You can ssh to:

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

ssh turtlebot@turtlebot.local

[/pastacode]

so easy you could make an alias in your bash_profile!

Here’s how you do it:

Always a good idea to get an update and then get the package:

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install avahi-daemon

[/pastacode]

Then you need to make some changes on your turtlebot machine:

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

sudo pico /etc/hosts
# edit the line 127.0.1.1 to whatever you want the name to be
127.0.1.1    ___NAME___

sudo pico /etc/hostname
# edit this file to the same name as above
___NAME___

# now you need to tell avahi to set a .local address
sudo pico /etc/avahi/avahi-daemon.conf
# uncomment the following line
domain-name=local

[/pastacode]

Now just restart the service and reboot your computer!

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

sudo service avahi-daemon restart
sudo reboot

[/pastacode]

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.