-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simplest-thing.js non detected during scan #99
Comments
This can happen when you’re running multiple mDNS servers on the same host. If you add your device by IP address, or use localhost, it should work fine. |
Yes, as I said when I manually add it it works but ideally I'd like them to be autodetected. Beside the property/action discovery the broadcasting capabilities of Things is interesting. When you mentioned "multiple mDNS servers on the same host" how can I know if that's the case? Does the Gateway and some adapters or bridge do that and conflict with each other? Would it help to host the Thing on another device than the Gateway? |
The gateway runs an mDNS server as well, which would then conflict with the web thing. That's why you end up with the |
I followed the same process and tried on my desktop which, from all I can remember, has no |
Is |
Indeed I have |
So, again, that's the conflicting mDNS service. If you stop that daemon and try again, do you get the expected result? |
Yes! Now that worked right away. So... I'm not sure what to proceed from there since I imagine the audience for this example is people who are not yet familiar with |
There are other mDNS libraries we could theoretically use for Node that just plug into avahi. I chose our current one specifically because it was cross-platform and pure JS, but that has obviously led to other issues. Thoughts? |
Indeed I was precisely wondering how reliably could the |
We actually do this in the gateway... kind of. If we see that avahi is running, we just move on, otherwise we start up our own mDNS server. In the case of this library, the preferred thing would be to switch libraries at runtime, but that obviously leads to an additional platform-dependent dependency. |
Actually, scratch that. We stopped doing that a while ago. We just rely on the system service at this point. |
No error while I start it using
node simplest-thing.js
and when I verify using curl.Yet, when I try to add the device, it doesn't get detected. If I manually add it though, it works.
While checking the logs of the gateway I notice this error
2020-11-05 08:12:03.765 INFO : thing-url-adapter: Failed to connect to http://gateway (2).local:8888: FetchError: request to http://gateway/%20(2).local:8888 failed, reason: connect ECONNREFUSED 127.0.1.1:80
which happened every time simplest-thing.js was started and during the scan.I assume the error comes from the hostname
gateway (2).local
being wrong. I do havegateway
andgateway.local
in/etc/hosts/
but I have never seen "gateway (2)" or added that manually anyway.The text was updated successfully, but these errors were encountered: