Comments (8)
Hmm I guess I could write this in the readme. The hostname is gw-
followed by the MAC address in lowercase without any separators. The MAC address is printed on the label under the gateway.
from node-tradfri-client.
That is how I assumed it was: However, I was unable to connect when only entering the hostname (ERR_NAME_NOT_RESOLVED).
My case might be slightly special though as I'm running the development inside a Docker container which in turn is ran on a virtual machine π
from node-tradfri-client.
Hmm, can you open the console on your machine and run node
, then enter the following code (edit the hostname)
var dns = require("dns");
dns.resolve("gw-xyzabc", function(err, addr) {
if (err) {
console.log("ERROR: " + err);
} else {
console.log(JSON.stringify(addr));
}
});
and post the output here? I'd need some more info as I haven't heard about that error in a nodejs context.
from node-tradfri-client.
I think I've figured out why it would not resolve: I'm running a pihole in my network as my DNS server, which apparently messes with how this is supposed to work. When the pihole is inactive the adress resolves correctly, output of command is:
dns.resolve('gw-dcefcabcf84d', (err, addr) => err ? console.log(err) : console.log(JSON.stringify(addr)))
// => ["192.168.1.55"]
from node-tradfri-client.
I wonder if I can get it to work automatically while still having the pihole present on the network.
from node-tradfri-client.
For reference this is the result when running the same code when the pihole is active:
dns.resolve('gw-dcefcabcf84d', (err, addr) => err ? console.log(err) : console.log(JSON.stringify(addr)))
// => { Error: queryA ENOTFOUND gw-dcefcabcf84d
at errnoException (dns.js:55:10)
at QueryReqWrap.onresolve [as oncomplete] (dns.js:243:19)
code: 'ENOTFOUND',
errno: 'ENOTFOUND',
syscall: 'queryA',
hostname: 'gw-dcefcabcf84d' }
from node-tradfri-client.
Maybe enabling the pi-hole's DHCP helps with that:
https://www.reddit.com/r/pihole/comments/5xepzl/local_hostname_resolution/
Or you can add the gateway to /etc/hosts on the pihole:
https://discourse.pi-hole.net/t/trouble-using-pihole-to-resolve-local-hostnames/2163/2
Closing this as it doesn't seem to be a library issue.
from node-tradfri-client.
Thank you for the suggestion, I will try that out. π
from node-tradfri-client.
Related Issues (20)
- setColorTemperature does not affect real bulb when it's off HOT 4
- observeGroupsAndScenes hangs after gateway update HOT 14
- Can set group brightness but not colour temperature HOT 9
- Other rgb ligths not recognized as rgb but as white HOT 3
- New properties in gateway firmware v1.13.21 HOT 3
- v2.2.0 build issues from shared-types HOT 3
- TRADFRI Shortcut-Button HOT 2
- Correctly iterating bulbs HOT 2
- Any news about support for motion sensor? HOT 6
- `device updated` events during transition time HOT 2
- problems with firmware 1.15.34 HOT 5
- Can no longer connect after being shut off during vacation HOT 2
- High transition time is ignored in my setup HOT 3
- The network stack was reset. crashes Node-Red HOT 3
- Amazing library - A big thank you HOT 1
- Unknown cipher in Electron HOT 39
- warnings about unknown properties
- UnhandledPromiseRejectionWarning while pairing HOT 2
- Check if switching to mdns-scanner makes sense
- discoverGateway returns null HOT 2
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-tradfri-client.