harmonyhubjs-discover
harmonyhubjs-discover copied to clipboard
not discovering hub
Is this library still expected to be able to discover a hub on my local network? It's not working for me.
Here is my code:
const HarmonyHubDiscover = require('harmonyhubjs-discover');
const harmonyHubDiscover = new HarmonyHubDiscover(61991);
var hubs = [];
harmonyHubDiscover.on('online', function(hub) {
console.log('harmony hub online', hub);
hubs.push(hub);
});
harmonyHubDiscover.on('offline', function(hub) {
console.log('harmony hub offline', hub);
});
harmonyHubDiscover.on('update', function(hubs) {
console.log('update!');
const knownHubIps = hubs.reduce(function(prev, hub) {
return prev + (prev.length > 0 ? ', ' : '') + hub.ip
}, '')
console.log('known ips: ' + knownHubIps);
});
console.log('looking for harmony hubs...');
harmonyHubDiscover.start();
When I run it, don't see any log events that correspond to the event listeners (eg "update!", "harmony hub online", etc)
here is console output with debugging:
looking for harmony hubs...
harmonyhubjs:discover:explorer start() +188ms
harmonyhubjs:discover:responsecollector ResponseCollector(61991) +1ms
harmonyhubjs:discover:responsecollector start() +2ms
harmonyhubjs:discover:ping start() +4ms
harmonyhubjs:discover:ping emit() +1s
harmonyhubjs:discover:ping emit() +1s
harmonyhubjs:discover:ping emit() +1s
harmonyhubjs:discover:ping emit() +1s
harmonyhubjs:discover:explorer executeCleanUp() +995ms
harmonyhubjs:discover:ping emit() +5ms
harmonyhubjs:discover:ping emit() +1s
harmonyhubjs:discover:ping emit() +999ms
harmonyhubjs:discover:ping emit() +1s
harmonyhubjs:discover:ping emit() +1s
harmonyhubjs:discover:explorer executeCleanUp() +974ms
harmonyhubjs:discover:ping emit() +26ms
harmonyhubjs:discover:ping emit() +1s
harmonyhubjs:discover:ping emit() +1s
harmonyhubjs:discover:ping emit() +1s
harmonyhubjs:discover:ping emit() +1s
... just keeps going like this indefinitely
system info: Windows 10 node v10.16.0 anything else relevent? If it makes a difference, I did update the logitech firmware to support XAMP as per https://www.domoticz.com/forum/viewtopic.php?t=26173#p202078
thanks for any guidance or help
i don't know about the latest generations of harmony hubs (protocol etc.) ... some caveat "back in the days" was always the IP subnet: the hub has to be in the same subnet as the computer you are exploring from.
i can't give you more insight here, sorry.