4

Background:

I am running a Linux sever on a local network that acts as both a web server and a central communications server. This server communicates with multiple nodes in the system. Upon node initialization, the node sends its IP address to the central communications server. However, in order to know the destination of where to send this IP address, the node needs to know the IP address of the server. In order to resolve the server, I was directed towards using mDNS.

It appears installing avahi on the server enables multicasting for the Linux server.

sudo apt-get install avahi-daemon

Then the host name of the server can be changed to where multicasting will resolve the server's IP address to

hostname.local

Question 1:

Do the nodes also have to have the avahi-daemon installed in order for this scheme to work? If so, is there a way to bypass this, or enable multicasting for the nodes in another manner. I am hesitant as I am unsure if the micro controller has the ability to install this daemon, as the ESP8226 is being used as the WiFi module. (I do know the ESP8226 does support mDNS, I just do not know how exactly).

Question 2:

If a user tries to access a page on the web server, can they just type the mDNS name into a browser to issue the request? Or do they also have to have the avahi-daemon installed? If it is a windows computer trying to access the application, I can not guarantee they will have this functionality built in. Again, if it is required, is there a way to work around not having the daemon?

Update: The ESP8226 does support mDNS, however client mDNS is not built in. There is, however, a client mDNS library for the ESP8226 here: https://github.com/mrdunk/esp8266_mdns

cg14
  • 41
  • 1
  • 3

2 Answers2

0

If these controllers are going into a business network the "central comms server" should be able to be controlled by the onsite IT (At least the static IP). So tell them that you need to have an A record for "centralcommsserver" or whatever you want and then let your controller look for centralcommsserver.DNSSuffix

jstuart-tech
  • 146
  • 5
0

Question 1: Unfortunately you have to have avahi or bonjour (win/mac) installed in order to use mDNS. Good luck compiling avahi for the microcontroller! I've never used mDNS with wifi either, but it's really very normal multicast traffic.

Question 2: You can use the mDNS name for http stuff, avahi completely integrates it with DNS. I was actually using it to load NFS shares. Remember if you use vhosts, to add the hostname.local as an Alias for the vhost or something.

Some Linux Nerd
  • 3,157
  • 3
  • 18
  • 20
  • 1
    Good news is the Wifi controller has a library that can be used for client mDNS. As for the browser mDNS: It seems to me, if a windows computer is being run, then the bonjour service also has to be installed. Is this correct? – cg14 Mar 25 '16 at 19:51