Add note about Lua mDNS client

This commit is contained in:
Marcel Stör 2018-07-01 21:28:08 +02:00
parent 8dc6eb62df
commit cb694d59af
1 changed files with 7 additions and 3 deletions

View File

@ -3,7 +3,11 @@
| :----- | :-------------------- | :---------- | :------ | | :----- | :-------------------- | :---------- | :------ |
| 2016-02-24 | [Philip Gladstone](https://github.com/pjsg) | [Philip Gladstone](https://github.com/pjsg) | [mdns.c](../../../app/modules/mdns.c)| | 2016-02-24 | [Philip Gladstone](https://github.com/pjsg) | [Philip Gladstone](https://github.com/pjsg) | [mdns.c](../../../app/modules/mdns.c)|
[Multicast DNS](https://en.wikipedia.org/wiki/Multicast_DNS) is used as part of Bonjour / Zeroconf. This allows system to identify themselves and the services that they provide on a local area network. Clients are then able to discover these systems and connect to them. [Multicast DNS](https://en.wikipedia.org/wiki/Multicast_DNS) is used as part of Bonjour / Zeroconf. This allows systems to identify themselves and the services that they provide on a local area network. Clients are then able to discover these systems and connect to them.
!!! note
This is a mDNS *server* module. If you are looking for a mDNS *client* for NodeMCU (i.e. to query mDNS) then [udaygin/nodemcu-mdns-client](https://github.com/udaygin/nodemcu-mdns-client) may be an option.
## mdns.register() ## mdns.register()
Register a hostname and start the mDNS service. If the service is already running, then it will be restarted with the new parameters. Register a hostname and start the mDNS service. If the service is already running, then it will be restarted with the new parameters.
@ -15,7 +19,7 @@ Register a hostname and start the mDNS service. If the service is already runnin
- `hostname` The hostname for this device. Alphanumeric characters are best. - `hostname` The hostname for this device. Alphanumeric characters are best.
- `attributes` A optional table of options. The keys must all be strings. - `attributes` A optional table of options. The keys must all be strings.
The `attributes` contains two sorts of attributes -- those with specific names, and those that are service specific. [RFC 6763](https://tools.ietf.org/html/rfc6763#page-13) The `attributes` contains two sorts of attributes those with specific names, and those that are service specific. [RFC 6763](https://tools.ietf.org/html/rfc6763#page-13)
defines how extra, service specific, attributes are encoded into the DNS. One example is that if the device supports printing, then the queue name can defines how extra, service specific, attributes are encoded into the DNS. One example is that if the device supports printing, then the queue name can
be specified as an additional attribute. This module supports up to 10 such attributes. be specified as an additional attribute. This module supports up to 10 such attributes.
@ -35,7 +39,7 @@ Various errors can be generated during argument validation. The NodeMCU must hav
mdns.register("fishtank", {hardware='NodeMCU'}) mdns.register("fishtank", {hardware='NodeMCU'})
Using `dns-sd` on OS X, you can see `fishtank.local` as providing the `_http._tcp` service. You can also browse directly to `fishtank.local`. In Safari you can get all the mDNS web pages as part of your bookmarks menu. Using `dns-sd` on macOS, you can see `fishtank.local` as providing the `_http._tcp` service. You can also browse directly to `fishtank.local`. In Safari you can get all the mDNS web pages as part of your bookmarks menu.
mdns.register("fishtank", { description="Top Fishtank", service="http", port=80, location='Living Room' }) mdns.register("fishtank", { description="Top Fishtank", service="http", port=80, location='Living Room' })