Comments (3)
I am respecting the location header being returned. The search data being returned to me from my bridge has a value of http://192.168.2.150:80/description.xml
for the LOCATION value.
The point of the code that you indicate as hard coded is a direct link to the description.xml file, but is not used in the lookup from the SSDP lookups.
I had looked at your library in the past, but I wanted this library to be a small as possible, and your SSDP library includes a lot of extra dependencies that I did not want to pull in for an edge case bridge lookup that over 95% of users of the library would not need. When Hue released an update to finding of the bridges, they now have a broker service, which is the preferred discovery method.
from node-hue-api.
I'm not sure that it is respecting the location header. Take a look at this gist.
If you run server.js, it'll open two http servers - one on port 80, one on 8080 and set up a dgram socket to respond to bridge search requests.
The dgram socket responds with LOCATION: http://localhost:8080/foo.xml
in the message, so if node-hue-api
respects the location header, it should make a request to port 8080 and request /foo.xml
.
search.js
contains the upnp example search code from the node-hue-api
readme. When I run it I see:
$ sudo node server.js
Socket listening
Responding to bridge search request
Responded to bridge search request
Got request for /description.xml on port 80
$ node search.js
Hue Bridges Found: [{"id":"WRONG PORT!","ipaddress":"localhost"}]
So it's requesting http://localhost:80/description.xml
even though the LOCATION
header in the search response is http://localhost:8080/foo.xml
.
from node-hue-api.
Thanks for that, the penny finally dropped. I had checked that the LOCATION was being returned in the SSDP results, but of course you were right, as after that I defaulted to pulling the discovery xml via an API call, thereby not actually following the URL.
I have switched the code to issue a simplified HTTP GET on the LOCATION that is returned, which has no change on my bridge, as it is returning the http://192.168.2.150:80/description.xml
value for me.
This has been released in version 1.1.1
of the library.
from node-hue-api.
Related Issues (20)
- getUser and getUserByName do not seem to work at all HOT 1
- Error when using Webpack / Electron HOT 1
- Example typo
- Touchlink activation HOT 1
- Cant get this to work with React.JS HOT 2
- Export as esm module HOT 20
- mDNS Discovery HOT 4
- ApiError: Problems resolving hue bridges, HTTP error status: 429 HOT 15
- Cannot import createLocal using TypeScript HOT 3
- Example doesn't work HOT 2
- api.sensors.updateSensorConfig not working due to un-settable params included in request HOT 3
- Failed to create sensor from bridge model: Error: Unknown type 'zllrelativerotary' to create Bridge Model Object HOT 3
- MDNS Discovery not working (Empty Array) HOT 12
- Implement RGB support for groups HOT 1
- Hue API V2
- ApiError: Problems resolving hue bridges, HTTP error status: 429 HOT 1
- bridge-validation.ts is missing bridgeid
- setLightState sets bri to 1 [esmodules] HOT 1
- Cannot be used in browser due to a minor issue
- Please make Rate Limiting configurable HOT 3
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 node-hue-api.