WebThingsIO / thing-url-adapter

Proxy adapter for Web Thing API endpoints
Mozilla Public License 2.0
21 stars 18 forks source link

Consider support for simpler mDNS configuration #15

Closed hobinjk closed 6 years ago

hobinjk commented 6 years ago

At least one embedded mDNS library doesn't support subtypes. We should consider one of three approaches:

  1. Support or switch to _webthing._tcp
  2. Support _http._tcp with a txt record of webthing=true
  3. Fix any libraries that don't support subtypes (I'll conduct a quick survey tomorrow to see if this is widespread)

Do any of these approaches sound reasonable? Is there a good alternative I haven't covered?

mdburmeisterbrown commented 6 years ago

Either #1 or #2 have the advantage of not requiring library upgrades. #2 has the advantage of being more universally discoverable, so I would vote for that (good suggestion, James!)

3 also works if it is just the ESP library being a bit of a subset. Please note that the ESP8266 represents a huge percentage of commercial (as well as maker) devices (eg, tuya.com) so we should make sure it is directly supported somehow. For example, all our forthcoming IoT devices use ESP chipsets to date.

mrstegeman commented 6 years ago

I did run into several libraries without proper sub-type support (i.e. bonjour), but was able to work around it or find a different library in all cases.

In my opinion:

  1. Easiest option.
  2. Probably better than 1, given that it really is pure HTTP.
  3. The proper thing to do.
hobinjk commented 6 years ago

Here's the results of my initial survey of the landscape:

I think 2 is the best approach to support since that gets us support for ESP8266 and ESP32. I think it's also an easier target for modifying the WiFi101 library. Based on how most of the examples with the other boards tell the user to print out the IP address on a serial port I think it's reasonable to say that users of these boards should use Add Thing by URL with the IP address they're already getting.

mrstegeman commented 6 years ago

I'm fine with that. Do we want to support _webthing._sub._http._tcp as well, or just the new scheme?

hobinjk commented 6 years ago

I think we should view _http._tcp with a txt record webthing=true to be just an alternate way of specifying the _webthing subtype and keep both supported.

mrstegeman commented 6 years ago

Agreed.