1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00
node-red-nodes/io/mdns
Sam Machin 2d28a2304f
Update package.jsons for mono-repo (#851)
Update the package.json for each node to point to the directory within the repo that hosts the code for the package in question.  as per https://docs.npmjs.com/cli/v7/configuring-npm/package-json#repository
2021-11-02 15:22:30 +00:00
..
icons Add discovery (mdns) and SNMP nodes 2015-03-04 19:55:53 +00:00
LICENSE Update licenses and packages for all nodes 2016-11-06 20:26:19 +00:00
mdns.html let discovery node not flag empty service type 2021-07-22 18:06:48 +01:00
mdns.js node-red-node-discovery: Add status information (#383) 2017-11-30 23:34:49 +00:00
package.json Update package.jsons for mono-repo (#851) 2021-11-02 15:22:30 +00:00
README.md add to mdns/discovery pre-reqs in readme 2020-02-04 19:09:53 +00:00

node-red-node-discovery

A Node-RED node that uses Bonjour / Avahi to discover local network services such as iTunes libraries, printers, etc.

It also supports announcing new services.

Prerequisites

please read the install instructions for the underlying npm.

For Debian / Ubuntu this requires installing

    sudo apt-get install libavahi-compat-libdnssd-dev libudev-dev

Install

Run the following command in your Node-RED user directory - typically ~/.node-red

    npm i node-red-node-discovery

Usage

Discovery

Uses an implementation of mdns to provide a Bonjour / Avahi service discovery capability.

msg.payload contains the service object on both arrival and leaving.

msg.payload.state contains boolean true or false depending if the service has arrived (true) or gone away (false)..

Within the msg.payload object the most interesting things are:

  • msg.payload.name
  • msg.payload.interface
  • msg.payload.port
  • msg.payload.addresses
  • msg.payload.txtRecord

For a full list of official service types see [this list](http://www.dns-sd.org/ServiceTypes.html" target="_new).

Announce

Provides a Bonjour / Avahi / Zeroconf announcement node.

If msg.payload is false - the announcement is stopped. Any other value starts the announcement process.

The announcement can be customised by the msg if not configured in the edit panel.

  • msg.service - For a full list of official service types see this list.
  • msg.port - the tcp or udp port to use.
  • msg.name - the short description name of the service. If you use %h in the name, it will be replaced by the machine hostname.
  • msg.txtRecord - a set of comma separated name:value pairs

Note:

When Node-RED starts you will get a big WARNING message about the Bonjour Compatibility layer... this is just a warning so don't worry.