I wasted several hours investigating the `Error: getaddrinfo -3008` and couldn't solve it with any of the solutions proposed on this repo's issues nor on the dependency (`mdns` repo)[https://github.com/agnat/node_mdns].
In the end, it boiled down to DietP's minimalistic approach to default packages that don't even provide `avahi-daemon` out of the box (as you need to install it with `dietpi-software`) and looks like this wasn't enough for this node to work, I needed an extra prerequisite lib: `libnss-mdns`.
I didn't try uninstalling `libavahi-compat-libdnssd-dev` or `libudev-dev` to check if those are not needed for DietPi installations, but what solved in my case was installing this extra package.
I hope it helps someone in the future
1- Ensure we stop advertising before creating a new advertiser if the object exists
2- Allow bool false to stop advertising
3- Documentation correction (state is in msg.payload, not in msg)