Help us understand the problem. What is going on with this article?

PepperをBonjourサービスで探す

More than 3 years have passed since last update.

OSXの場合dns-sdコマンドを使います。

サービスタイプ

サービスタイプは以下の2つのようです。

サービスタイプ
_nao._tcp Pepper本体のみ
_naoqi._tcp バーチャルロボットも含む

探し方

> dns-sd -B _nao._tcp

Browsing for _nao._tcp
DATE: ---Sun 10 Jan 2016---
 0:50:04.697  ...STARTING...
Timestamp     A/R    Flags  if Domain               Service Type         Instance Name
 0:50:04.697  Add        2   4 local.               _nao._tcp.           pepper
^C
> dns-sd -B _naoqi._tcp

Browsing for _naoqi._tcp
DATE: ---Sun 10 Jan 2016---
 1:10:44.117  ...STARTING...
Timestamp     A/R    Flags  if Domain               Service Type         Instance Name
 1:10:44.118  Add        3  -1 local.               _naoqi._tcp.         MBP.local
 1:10:44.118  Add        2   4 local.               _naoqi._tcp.         pepper
^C

普通にpepper.localでアクセスできますが、IPを探したい場合はInstance Nameで検索することができます。

> dns-sd -q pepper.local

DATE: ---Sun 10 Jan 2016---
 0:49:32.685  ...STARTING...
Timestamp     A/R Flags if Name                          Type  Class   Rdata
 0:49:32.686  Add     2  4 pepper.local.                 Addr   IN     192.168.1.115
^C

ま、普通にPingしてもIP取得できるんですが、練習ということで。

> ping -c1 pepper.local 
PING pepper.local (192.168.1.115): 56 data bytes
64 bytes from 192.168.1.115: icmp_seq=0 ttl=64 time=7.123 ms

--- pepper.local ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 7.123/7.123/7.123/0.000 ms

ごにょごにょ

どこにも具体的なサービスタイプの資料が無いのですが、以下のコードを参考にしました。
https://github.com/cgestes/ctafconf/blob/master/profile/aldebaran/bin/rlist
Linuxの場合はavahiというBonjour(mDNS)実装がありavahi-browseコマンドで同様に参照ができるようです。

資料が見つからなかったのでメモとして残しておきます。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away