Bonjour advertising (UDP) in local Wifi

Hello All.

Has anyone implemented a Bonjour findable device?

I am looking for a way for the particle to advertise itself (once connected to wifi router) and have a computer find its address without using the cloud.

Have anyone has any experience with this? I guess is something with UDP advertising…

Any help welcomed!

Hi,

It can be done I think with multicast. After device got ip from router it can send multicast with information you need. Address and port of multicast can be well known for subscriber.

Adafruit did a CC3000 mDNS/Bonjour client. The problem with mDNS is you need to continuously monitor the broadcast stream for other nodes joining with the same name so your node can say it already has that name (there is no centralized control). This was big resource drain on a Core but on a Photon, particularly after multi-tasking comes along, I think it should be great.

1 Like

I have done something similar last year, modified the Adafruit mDNS client on Spark Core but not tested on Photon.

3 Likes

What happens if you create a UUID so no one else can join the broadcast stream with the same name? Say use the MAC address for the name? Would you still need to monitor the stream?

If you want to implement the protocol properly, yes, you do need to monitor. You also need to answer “who knows who xxxx is?” requests since there is no central server.

The TI CC3000 in there sample code implemented a very simple start-up broadcast 3 mDNS packets version but it never worked for me with any other mDNS or Bonjour clients.