Connect to beaglebone.local

Is it possible to access the beaglebone like this?

  $ ssh root@beaglebone.local

When I do I get this error:

  "ssh: Could not resolve hostname beaglebone.local: nodename nor servname provided, or not known"

I checked the hostname and hosts files, and added "127.0.0.1 beaglebone" to the hosts, but not sure what else I can do?

  # cat /etc/hostname
  beaglebone

  # cat /etc/hosts
  127.0.0.1 localhost.localdomain localhost
  127.0.0.1 beaglebone

So far I've only been able to access it like:

  $ ssh root@<ip_address>

But it would be great to know how to connect when I use it on new networks.

Owen

Hi,

Is it possible to access the beaglebone like this?

   $ ssh root@beaglebone\.local

How are you connected to the beaglebone and what OS are you using? Are
U using the usb connector or is the device connected via the ethernet
port?
If you are connected via the ethernet it should basically work. The
dhcp client on the beaglebone will register to your the dhcp server on
your network.
If you are connecting over usb things are a little more complicated.

What I usually end up doing is to create a ssh configuration file what
will look like this
cat .ssh/config
Host beaglebone
HostName 192.168.1.2 (certainly not 127.0.0.1 as this is a loopback address)
User root

you can then do an ssh beaglebone directly.

Greetings

I’m on a MacBook Pro with OSX 10.7.

I can add ~/.ssh/config to my Mac with the following and access the BeagleBone easily with $ ssh beaglebone

Host beaglebone
HostName 192.168.1.105
User root

But I don’t always know the IP address of the board on other networks so I’m hoping to access it with with a name like: beaglebone.local

Owen

If the mDNS registration on the beaglebone is working properly, you
shouldn't need to do anything to acess the board through
beaglebone.local. Delete those entries from /etc/hosts and
~/.ssh/config and make sure avahi-daemon is running.

On the default Angstrom image, you want to do something like:
sudo systemctl enable avahi-daemon.service

On Ubuntu, it's something along these lines:
sudo apt-get install avahi-daemon
sudo initctl start avahi-daemon

If that doesn't work, run systemctl status avahi-daemon.service and/or
check the logs to see why it didn't start correctly.

OK, deleted entries and checked:

  # avahi-daemon
  Daemon already running on PID 95

But, it looks like there is a problem (below). Pardon my lack of experience, but where can I find logs on Angstrom?

  # systemctl status avahi-daemon.service
  avahi-daemon.service - Avahi mDNS/DNS-SD Stack
      Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled)
      Active: failed (Result: exit-code) since Sun, 02 Jan 2000 00:18:22 +0000; 12 years and 4 months ago
    Main PID: 107 (code=exited, status=255)
      CGroup: name=systemd:/system/avahi-daemon.service

With that /etc/hosts file you should be able to use one of:

      $ ssh root@beaglebone
      $ ssh root@localhost
      $ ssh root@localhost.localdomain

Err, this is from the beaglebone itself. Sort of
a useless thing to do...

Hi, I’ve defaulted to using Stackoverflow if anyone has other ideas:
http://stackoverflow.com/questions/10537816/cannot-connect-to-beaglebone-local

Owen

OK, deleted entries and checked:

   \# avahi\-daemon
   Daemon already running on PID 95

But, it looks like there is a problem (below). Pardon my lack of experience, but where can I find logs on Angstrom?

There are several logs under /var/log/, including /var/log/messages
where many system messages are kept, including ones from the launch of
avahi-daemon.

I found a couple of the hints on
http://fedoraproject.org/wiki/How_to_debug_Systemd_problems to be
helpful, but be sure to ignore anything about grub.

Just poking around, I did:
root@beaglebone:~# ps auwx | grep syslog
root 60 0.0 0.2 2016 704 ? Ss Apr30 0:04
/lib/systemd/systemd-stdout-syslog-bridge
root 160 0.0 0.6 35892 1592 ? Ssl Apr30 0:08
/usr/sbin/rsyslogd -n -c5
root 7405 0.0 0.2 1776 580 pts/0 S+ 18:04 0:00 grep syslog

From that, I suppose you can configure where syslog messages go with
/etc/rsyslog.conf.

I believe there is a way to get additional log data out of systemd,
but I haven't (re?)found the command line magic, so I could be wrong
on that.

   \# systemctl status avahi\-daemon\.service
   avahi\-daemon\.service \- Avahi mDNS/DNS\-SD Stack
             Loaded: loaded \(/lib/systemd/system/avahi\-daemon\.service; enabled\)
             Active: failed \(Result: exit\-code\) since Sun, 02 Jan 2000 00:18:22 \+0000; 12 years and 4 months ago
           Main PID: 107 \(code=exited, status=255\)
             CGroup: name=systemd:/system/avahi\-daemon\.service

Mine shows:
root@beaglebone:~# systemctl status avahi-daemon.service
avahi-daemon.service - Avahi mDNS/DNS-SD Stack
    Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled)
    Active: active (running) since Sat, 01 Jan 2000 00:00:05 +0000; 12
years and 4 months ago
  Main PID: 104 (avahi-daemon)
    Status: "avahi-daemon 0.6.30 starting up."
    CGroup: name=systemd:/system/avahi-daemon.service
      ├ 104 avahi-daemon: running [beaglebone.local]
      └ 124 avahi-daemon: chroot helper

Guess there is a chance something is wrong with your config.

Hmm... I seem to be missing some things:

# ls -la /var/log
total 81
drwxr-xr-x 4 root root 1024 Mar 6 14:14 .
drwxr-xr-x 12 root root 1024 Mar 6 14:14 ..
-rw------- 1 root utmp 0 Jan 1 2000 btmp
drwxr-xr-x 2 root root 1024 Mar 6 14:14 gateone
drwxr-xr-x 4 root root 1024 Feb 14 15:15 journal
-rw-r--r-- 1 root root 292 May 10 17:08 lastlog
-rw-rw-r-- 1 root utmp 76416 May 10 17:08 wtmp

I added a hack I discovered to the Stackoverflow so at least I can keep working :slight_smile:
http://stackoverflow.com/a/10538940/441878

I like to connect to my router that has a table of dhcp clients. It is usually quite easy to find the beaglebone. Ping beaglebone.local did work out of the box with the standard openembedded image. With the Ubuntu image, the hostname had changed to omap, an name lookup was not working anymore. Perhaps a solution would be installing WINS, I haven't explored this though

On the beaglebone with Ubuntu do

$ cat /etc/hostname

(verify the hostname)

then run

$ sudo apt-get install libnss-mdns

Will this work on Angstrom?

No, on angstrom mdns is enabled by default, so no config is needed on the beaglebone side.

Koen, except on the latest non-GNOME image, it’s not working, I can confirm mDNS (Avahi) is not starting properly.

On this demo image:
Angstrom-Cloud9-IDE-eglibc-ipk-v2012.04…

The 2012.05 is GNOME only and I don’t want to haul 200M of GUI stuff when I don’t need it.

Also syslogd has been borked on and off since 2012.02

Lastly, opkg update; opkg upgrade is a guaranteed way to bork the OS (last I did, it ran out of space on filesystem).

I’m investigating building my own Angstrom or Ubuntu, I have located bits of info here and there but no comprehensive guide.

Cheers,
Eric

Also note that some routers not supporting mdns-forwarding between interfaces (i.e. your beaglebone sitting on ethernet and your notebook on WiFi). Then local name resolution won’t work.
To test if this is the problem, just connect your notebook to ethernet as well and see if it starts working!

I had as similar problem to original poster using Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.05-beaglebone-2012.04.22.img.xz.

My bone could only addressed as “beaglebone.local” after reboot about 50% of the time. When beaglebone.local was not working after reboot, “systemctl status avahi-daemon.service” showed the same “failed with exit code 255” message as in the original post. Interestingly, in this situation a “systemctl start avahi-daemon.service” always succeeded and made “beaglebone.local” available on the network.

Also in the failure case, “journalctl | grep avahi” returned a single message stating something like “Daemon already running on PID NNN”.

I “fixed” these failures by adding the line “ExecStartPre=/bin/rm -f /var/run/avahi-daemon/pid” to the [Service] section of /lib/systemd/system/avahi-daemon.service. beaglebones.local now appearss 100% of the time after reboot.

I say “fixed” because I have not been able to track down the root cause that is leaving stray pid files around (nor have I really been able to “see” the stray pid files) - so I don’t have a true fix.

– Frank

I had a similar issue running my beaglebone on Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.05-beaglebone-2012.04.22.img.xz.

About 50% of the time after reboot, “beaglebone.local” would not appear on the network (although the bone would be available by IP address).

When this happened, “systemctl status avahi-daemon.service” showed that the avahi-daemon failed with “exit code 255”.

Interestingly, a subsequent “systemctl start avaihi-daemon.service” would always be successful and “beaglebone.local” would appear on the network.

Also “journalctl | grep avahi” returned a single message stating something like “Daemon already runnin gon PID NNN”.

So, I “fixed” the problem by adding the line “ExecStartPre=/bin/rm -f /var/run/avahi-daemon/pid” to the [Service] section of /lib/systemd/system/avahi-daemon.service.

With this addition, “beaglebone.local” now appears on the network 100% of reboots.

I say “fixed” (i.e., in quotes) because I have not been able to track down the root cause that is leaving around the stray avahi pid file(s) and thus don’t have a true fix.

– Frank

Great, worked for me. Thanks for the info.

Owen