Comments (2)
Improving this is tricky, to support both (for v6 enabled hosts) the gateway would need to send two requests to the discover site since on the server the incoming external host address is used for matching. Hence the v4 and v6 external addresses need to be known to generate matches.
Albeit the discover service is convenient it will be deprecated in the future, in favour of a more advanced local discovery.
In the past the main reason to provide the discover service was ability to easily open the web app without knowing the ip address (especially non-technical users). But this only works when internet is available, IPv4/v6 are used equally by gateway and browser, no fancy proxy settings are in place and internet discovery is enabled in the web app. UPnP doesn't work in browsers either due the missing UDP support and has further issues in corporate networks with multiple subnets.
We are currently quite busy developing a progressive web app (PWA) — oh these buzz words — which doesn't rely on a server based discover service and instead scans the local network for gateways. Thanks to javascript Service Workers and CORS this works even without internet connection and in proxy environments. Safari browser doesn't implement Service Workers yet, but I guess they will support it in a timely manner, until then app cache will be used for Safari.
https://jakearchibald.github.io/isserviceworkerready/
The documentation will be updated on how to discover local gateways via scanning, with a javascript example, since using javascript in browsers is the most tricky method.
In the end local scanning is more complicated than a single request to discover service, but it turns out to be much more reliable in our experience. In support feedback we often hear that users appreciate it a lot that the gateway doesn't rely on cloud and vendor services.
— Offline is a feature.
from deconz-rest-plugin.
Thanks for the explanation, Manuel. It's making sense to me, now.
to support both (for v6 enabled hosts) the gateway would need to send two requests to the discover site
Definitely tricky, but not impossible: send the same request twice, but force IPv4 on the second request. Alternatively, bluntly remove the IPv6 DNS entry for dresden-light.appspot.com
. The Philips Hue portal, www.meethue.com
doesn't resolve to IPv6 either. I doubt there's any IPv6-only consumers on the Internet, and even if there are, they couldn't use this discovery method, as the gateway registers its internal IPv4 address.
Out of interest: why doesn't the gateway register its (internal, link local) IPv6 address instead?
To testify to the tricky: it took me a couple of hours to find a trick to force IPv6 in NodeJS. Somehow NodeJS prefers IPv4 over IPv6 when a hostname resolves to addresses from both families, where all the other programmes (deCONZ, Safari, Chromium, curl
) on macOS and RaspBian seem to favour IPv6 (as they should).
Unfortunately, even with this trick, I still cannot use this discovery method, as the id
registered differs from the GWID.phoscon.de
advertised with UPnP (I recognise each bridge / gateway by its ID, to cope with changing addresses and/or names).
Could this be fixed in the next beta, together with the config.bridgeid
(and config.modelid
) attributes? What about the unauthenticated GET /api/config
?
In the end local scanning is more complicated than a single request to discover service, but it turns out to be much more reliable in our experience. In support feedback we often hear that users appreciate it a lot that the gateway doesn't rely on cloud and vendor services.
Yes, I definitely prefer local discovery over a cloud-based solution, both from a reliability as well as from a security perspective. I'm not too keen on a brute-force full network scan, though. As a fall back, the gateway's local address:port could be specified in some config file or settings/preferences. In either scenario, you need the unauthenticated GET /api/config
to retrieve the ID (as the username and other gateway-specific parameters are stored under the ID, to cope with changing addresses and/or names).
I tried UPnP discovery (SSDP) over IPv6 (using [FF02::C]
instead of 239.255.255.250
), but only Sonos and Fritz!, seem to support it.
Did you ever consider using Bonjour (DNS-SD)? I realise it still has an Apple ring to it, but it works quite reliably and supports IPv6. And there is an open source implementation for Linux. On the other hand, it also uses local network multicasts, so it might not work in corporate environments either, nor over (routing) VPNs.
from deconz-rest-plugin.
Related Issues (20)
- Translations Missing for sensor in Phoscon menu (German) HOT 1
- Sonoff SNZB-04P HOT 2
- Web access does not work in v2.27.6 HOT 9
- Namron Zigbee 2 Kanal 16a Bryter (4512768) HOT 5
- Third Reality, Inc. Smart Button 3RSB22BZ HOT 11
- Hue Motion Sensor (SML001) no longer pairing in latest STABLE v2.27.6 HOT 4
- Add support for MOES 1 Gang Switch HOT 15
- IKEA Parasoll abnormal battery drainage HOT 2
- Crashes HOT 17
- Woox water leak sensor R7050 HOT 11
- Mumibiz TYZGTH4CH with temperature HOT 4
- Third Reality Zigbee Smart Vibration Sensor 3RVS01031Z HOT 6
- Sonoff SNZB-02P Temperature and Humidity sensor HOT 6
- Request for Tuya Smart Zigbee Temp and Humidity Sensor manu:"_TZ3000_bjawzodf" / model: "TY0201" HOT 17
- Xiaomi Aqara FP1E HOT 5
- Moes ZSS-S01-GWM-C - Smart Door/Window Sensor HOT 5
- TZ3000 BSEED reports wrong power HOT 13
- Sensor status stops working after a short time HOT 1
- Zigbee Solar Rain Sensor RB-SRAIN01 HOT 8
- Tuya Mini PIR Zigbee 3.0 Sensor HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deconz-rest-plugin.